@@ -56,7 +56,7 @@ Metadata:
56
56
- DatabaseEncrpytedBoolean
57
57
- DatabaseCmk
58
58
- DatabaseMasterUsername
59
- - DatabaseMasterPassword
59
+ # - DatabaseMasterPassword
60
60
- DatabaseName
61
61
- Label :
62
62
default : Caching Tier
@@ -95,8 +95,8 @@ Metadata:
95
95
default : DB Instance Class
96
96
DatabaseMasterUsername :
97
97
default : DB Master Username
98
- DatabaseMasterPassword :
99
- default : DB Master Password
98
+ # DatabaseMasterPassword:
99
+ # default: DB Master Password
100
100
DatabaseName :
101
101
default : DB Name
102
102
EfsCmk :
@@ -319,14 +319,14 @@ Parameters:
319
319
MinLength : 1
320
320
Type : String
321
321
Default : moodle
322
- DatabaseMasterPassword :
323
- AllowedPattern : ^([a-zA-Z0-9`~!#$%^&*()_+,\\-])*$
324
- ConstraintDescription : Must be letters (upper or lower), numbers, spaces, and these special characters `~!#$%^&*()_+,-
325
- Description : The Amazon RDS master password. Letters, numbers, spaces, and these special characters `~!#$%^&*()_+,-
326
- MaxLength : 41
327
- MinLength : 8
328
- NoEcho : true
329
- Type : String
322
+ # DatabaseMasterPassword:
323
+ # AllowedPattern: ^([a-zA-Z0-9`~!#$%^&*()_+,\\-])*$
324
+ # ConstraintDescription: Must be letters (upper or lower), numbers, spaces, and these special characters `~!#$%^&*()_+,-
325
+ # Description: The Amazon RDS master password. Letters, numbers, spaces, and these special characters `~!#$%^&*()_+,-
326
+ # MaxLength: 41
327
+ # MinLength: 8
328
+ # NoEcho: true
329
+ # Type: String
330
330
DatabaseName :
331
331
AllowedPattern : ^([a-zA-Z0-9]*)$
332
332
Description : The Amazon RDS master database name.
@@ -806,6 +806,15 @@ Conditions:
806
806
!Equals [ true, !Ref UseCloudFrontBoolean ]
807
807
808
808
Resources :
809
+ MyRDSInstanceSecret :
810
+ Type : AWS::SecretsManager::Secret
811
+ Properties :
812
+ Description : ' This is the secret for my RDS instance'
813
+ GenerateSecretString :
814
+ SecretStringTemplate : !Sub '{"username": "${DatabaseMasterUsername}"}'
815
+ GenerateStringKey : ' password'
816
+ PasswordLength : 16
817
+ ExcludeCharacters : ' "@/\'
809
818
vpc :
810
819
Type : AWS::CloudFormation::Stack
811
820
Properties :
@@ -900,16 +909,16 @@ Resources:
900
909
!GetAtt [ vpc, Outputs.Vpc ]
901
910
TemplateURL : https://s3.amazonaws.com/aws-refarch/moodle/latest/templates/03-publicalb.yaml
902
911
rds :
903
- DependsOn : [ securitygroups, securitygroups ]
912
+ DependsOn : [ securitygroups ]
904
913
Type : AWS::CloudFormation::Stack
905
914
Properties :
906
915
Parameters :
907
916
DatabaseInstanceType :
908
917
!Ref DatabaseInstanceType
909
- DatabaseMasterUsername :
910
- !Ref DatabaseMasterUsername
911
- DatabaseMasterPassword :
912
- !Ref DatabaseMasterPassword
918
+ # DatabaseMasterUsername:
919
+ # !Ref DatabaseMasterUsername
920
+ MyRDSInstanceSecretArn :
921
+ !Ref MyRDSInstanceSecret
913
922
DatabaseName :
914
923
!Ref DatabaseName
915
924
DatabaseEncrpytedBoolean :
@@ -989,10 +998,10 @@ Resources:
989
998
Parameters :
990
999
DatabaseClusterEndpointAddress :
991
1000
!GetAtt [ rds, Outputs.DatabaseClusterEndpointAddress ]
992
- DatabaseMasterUsername :
993
- !Ref DatabaseMasterUsername
994
- DatabaseMasterPassword :
995
- !Ref DatabaseMasterPassword
1001
+ # DatabaseMasterUsername:
1002
+ # !Ref DatabaseMasterUsername
1003
+ MyRDSInstanceSecretArn :
1004
+ !Ref MyRDSInstanceSecret
996
1005
DatabaseName :
997
1006
!Ref DatabaseName
998
1007
ElasticFileSystem :
@@ -1032,10 +1041,10 @@ Resources:
1032
1041
Parameters :
1033
1042
DatabaseClusterEndpointAddress :
1034
1043
!GetAtt [ rds, Outputs.DatabaseClusterEndpointAddress ]
1035
- DatabaseMasterUsername :
1036
- !Ref DatabaseMasterUsername
1037
- DatabaseMasterPassword :
1038
- !Ref DatabaseMasterPassword
1044
+ # DatabaseMasterUsername:
1045
+ # !Ref DatabaseMasterUsername
1046
+ MyRDSInstanceSecretArn :
1047
+ !Ref MyRDSInstanceSecret
1039
1048
DatabaseName :
1040
1049
!Ref DatabaseName
1041
1050
ElasticFileSystem :
0 commit comments