CloudFormation으로 AWS Secrets Manager 보안 암호 생성
이 예제에서는 CloudFormationCreatedSecret-이라는 이름의 보안 암호를 생성합니다. 보안 암호 값은 다음 JSON으로, 보안 암호를 생성할 때 생성된 32자 암호를 포함합니다.a1b2c3d4e5f6
{ "password": "EXAMPLE-PASSWORD", "username": "saanvi" }
이 예제에서는 다음 CloudFormation 리소스를 사용합니다.
CloudFormation을 사용한 리소스 생성에 대한 자세한 내용은 CloudFormation 사용 설명서의 템플릿 기본 사항 알아보기를 참조하세요.
JSON
{ "Resources": { "CloudFormationCreatedSecret": { "Type": "AWS::SecretsManager::Secret", "Properties": { "Description": "Simple secret created by CloudFormation.", "GenerateSecretString": { "SecretStringTemplate": "{\"username\": \"saanvi\"}", "GenerateStringKey": "password", "PasswordLength": 32 } } } } }
YAML
Resources: CloudFormationCreatedSecret: Type: 'AWS::SecretsManager::Secret' Properties: Description: Simple secret created by CloudFormation. GenerateSecretString: SecretStringTemplate: '{"username": "saanvi"}' GenerateStringKey: password PasswordLength: 32