Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Coalfire AWS Secrets Manager Terraform Module

License

NotificationsYou must be signed in to change notification settings

CiscoOpsStack/terraform-aws-secretsmanager-ops_stack

 
 

Repository files navigation

Coalfire

AWS Secrets Manager Terraform Module

Description

This module creates secrets in AWS Secrets Manager. The variblenames is a list that will be used to create secrets for however many values are passed into the list.

Dependencies

No dependencies.

Resource List

  • Secrets Manager Secret
  • Secret Policy
  • Secret Version

Deployment Steps

This module can be called as outlined below.

  • Change directories to the directory that requires secrets and source the module as shown below.
  • From the directory runterraform init.
  • Runterraform plan to review the resources being created.
  • If everything looks correct in the plan output, runterraform apply.

Usage

The below example is how you can call secrets manager module to create secrets as needed. One important note is ensuring you exclude any characters for systems such as PGSQL. As there can be issues with the characters accepted by it. It's best to exclude#$/_%&"'=

If secrets need to be shared between AWS accounts, set "shared = true" and also provide "cross_account_ids".

locals{secrets=[    {    secret_name="test123"    secret_description="test service account for the 123 service"    },     {     secret_name="svc_test456"    secret_description=""    }  ]}module"secrets" {source="github.com/Coalfire-CF/terraform-aws-secretsmanager"partition=var.partitionsecrets=local.secretslength=15special=trueoverride_special="$%&!"kms_key_id=data.terraform_remote_state.setup.sm_kms_key_idpath=""shared=falsecross_account_ids=[""]}

Requirements

NameVersion
terraform>=1.5.0
aws~> 5.0
random~> 3.0

Providers

NameVersion
aws~> 5.0
random~> 3.0

Modules

No modules.

Resources

NameType
aws_secretsmanager_secret.thisresource
aws_secretsmanager_secret_policy.sharedresource
aws_secretsmanager_secret_version.thisresource
random_password.passwordresource
aws_iam_policy_document.resource_policy_MAdata source

Inputs

NameDescriptionTypeDefaultRequired
cross_account_idsA list of strings containing the account IDs of AWS accounts that should have cross-account access to this secretlist(string)nullno
empty_valueWhether the secret should be generated without a valueboolfalseno
global_tagsa map of strings that contains global level tagsmap(string){}no
kms_key_idSpecifies the ARN or alias of the AWS KMS customer master key (CMK) to be used to encrypt the secret values in the versions stored in this secret.stringn/ayes
lengthThe length of the password to be generatednumber15no
min_lowerMinimum number of lower case charactersnumber1no
min_numericMinimum number of numeric charactersnumber1no
min_specialMinimum number of special charactersnumber1no
min_upperMinimum number of upper case charactersnumber1no
override_specialProvide your own list of special charactersstring"_%@!"no
partitionThe AWS partition to usestringn/ayes
pathPath to organize secretsstringn/ayes
recovery_window_in_daysNumber of days that AWS Secrets Manager waits before it can delete the secret.number30no
regional_tagsa map of strings that contains regional level tagsmap(string){}no
secretsSpecifies the friendly name of the new secrets to be created as key and an optional value field for descriptionslist(map(string))n/ayes
sharedWhether secrets should be shared across accounts.boolfalseno
specialInclude special characters in random password stringbooltrueno
tagsA mapping of tags to assign to the resourcemap(string){}no

Outputs

NameDescription
namesReturns list of secret names to be created.
pathPath to secret values
secret_arnsThe ARN values of the generated secrets
secret_iam_policy_doc_jsonJSON doc of the policy output to use on roles if desired
secretsReturns all secrets generated by the secrets manager module

Contributing

If you're interested in contributing to our projects, please review theContributing Guidelines. And send an email toour team to receive a copy of our CLA and start the onboarding process.

License

License

Copyright

Copyright © 2023 Coalfire Systems Inc.

Requirements

NameVersion
terraform>=1.5.0
aws~> 5.0
random~> 3.0

Providers

NameVersion
aws~> 5.0
random~> 3.0

Modules

No modules.

Resources

NameType
aws_secretsmanager_secret.thisresource
aws_secretsmanager_secret_policy.sharedresource
aws_secretsmanager_secret_version.thisresource
random_password.passwordresource
aws_iam_policy_document.resource_policy_MAdata source

Inputs

NameDescriptionTypeDefaultRequired
cross_account_idsA list of strings containing the account IDs of AWS accounts that should have cross-account access to this secretlist(string)nullno
empty_valueWhether the secret should be generated without a valueboolfalseno
global_tagsa map of strings that contains global level tagsmap(string){}no
kms_key_idSpecifies the ARN or alias of the AWS KMS customer master key (CMK) to be used to encrypt the secret values in the versions stored in this secret.stringn/ayes
lengthThe length of the password to be generatednumber15no
min_lowerMinimum number of lower case charactersnumber1no
min_numericMinimum number of numeric charactersnumber1no
min_specialMinimum number of special charactersnumber1no
min_upperMinimum number of upper case charactersnumber1no
namesSpecifies the friendly name of the new secrets to be createdlist(string)n/ayes
override_specialProvide your own list of special charactersstring"_%@!"no
partitionThe AWS partition to usestringn/ayes
pathPath to organize secretsstringn/ayes
recovery_window_in_daysNumber of days that AWS Secrets Manager waits before it can delete the secret.number30no
regional_tagsa map of strings that contains regional level tagsmap(string){}no
sharedWhether secrets should be shared across accounts.boolfalseno
specialInclude special characters in random password stringbooltrueno
tagsA mapping of tags to assign to the resourcemap(string){}no

Outputs

NameDescription
namesReturns list of secret names to be created.
pathPath to secret values
secret_arnsThe ARN values of the generated secrets
secret_iam_policy_doc_jsonJSON doc of the policy output to use on roles if desired
secretsReturns all secrets generated by the secrets manager module

About

Coalfire AWS Secrets Manager Terraform Module

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL100.0%

[8]ページ先頭

©2009-2025 Movatter.jp