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