Last active
November 18, 2021 21:16
-
-
Save PaulDuvall/ce466d5417c30bafc238771109a18f51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyDBInstance: | |
Type: AWS::RDS::DBInstance | |
Properties: | |
AllocatedStorage: 20 | |
DBInstanceClass: db.t2.micro | |
Engine: mysql | |
MasterUsername: !Join ['', ['{{resolve:secretsmanager:', !Ref MyRDSInstanceRotationSecret, ':SecretString:username}}' ]] | |
MasterUserPassword: !Join ['', ['{{resolve:secretsmanager:', !Ref MyRDSInstanceRotationSecret, ':SecretString:password}}' ]] | |
BackupRetentionPeriod: 0 | |
DBInstanceIdentifier: 'rotation-instance' | |
VPCSecurityGroups: | |
- !ImportValue 'MySecurityGroupLambda' | |
DBSubnetGroupName: | |
Ref: "DBSubnetGroup" | |
#This is a SecretTargetAttachment resource which updates the referenced Secret resource with properties about | |
#the referenced RDS instance | |
SecretRDSInstanceAttachment: | |
Type: AWS::SecretsManager::SecretTargetAttachment | |
Properties: | |
SecretId: !Ref MyRDSInstanceRotationSecret | |
TargetId: !Ref MyDBInstance | |
TargetType: AWS::RDS::DBInstance |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment