AWS Secrets Manager secret with encryption.
Install Node.js and npm first!
npm i @cfn-modules/secret
If you pass in a KMS Module the key will be used to encrypt the secret.
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'cfn-modules example'
Resources:
Secret:
Type: 'AWS::CloudFormation::Stack'
Properties:
Parameters:
KmsKeyModule: !GetAtt 'Key.Outputs.StackName' # optional
Name: 'my-secret-name' #optional
Description: 'A secret description' #optional
CharactersToExclude: '"@/\' # optional
PasswordLength: 30 # optional
TemplateURL: './node_modules/@cfn-modules/secret/module.yml'
none
Name | Description | Default | Required? | Allowed values |
---|---|---|---|---|
KmsKeyModule | Stack name of kms-key module | no | ||
Name | The name to give the secret. This is the name shown in the AWS Console | auto generated value | no | |
Description | The description to give the secret. This is the description shown in the AWS Console | no | ||
CharactersToExclude | When generating the initial value these characters will not be used. | '"@/\' | no | |
PasswordLength | The length of the generated password. | 30 | no |
If you want to use an existing Secret, use the wrapper with the Arn
of the existing secret:
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'cfn-modules example'
Resources:
Secret:
Type: 'AWS::CloudFormation::Stack'
Properties:
Parameters:
Arn: 'arn:aws:secretsmanager:eu-west-1:111111111111:secret:name/of/secret' # required
TemplateURL: './node_modules/@cfn-modules/secret/wrapper.yml'