1
+ {
2
+ "Transform" : " AWS::SecretsManager-2020-07-23" ,
3
+ "Resources" : {
4
+ "DbSecurity381C2C15" : {
5
+ "Type" : " AWS::KMS::Key" ,
6
+ "Properties" : {
7
+ "KeyPolicy" : {
8
+ "Statement" : [
9
+ {
10
+ "Action" : " kms:*" ,
11
+ "Effect" : " Allow" ,
12
+ "Principal" : {
13
+ "AWS" : {
14
+ "Fn::Join" : [
15
+ " " ,
16
+ [
17
+ " arn:" ,
18
+ {
19
+ "Ref" : " AWS::Partition"
20
+ },
21
+ " :iam::" ,
22
+ {
23
+ "Ref" : " AWS::AccountId"
24
+ },
25
+ " :root"
26
+ ]
27
+ ]
28
+ }
29
+ },
30
+ "Resource" : " *"
31
+ }
32
+ ],
33
+ "Version" : " 2012-10-17"
34
+ }
35
+ },
36
+ "UpdateReplacePolicy" : " Retain" ,
37
+ "DeletionPolicy" : " Retain"
38
+ },
39
+ "testsecretF8BBC644" : {
40
+ "Type" : " AWS::SecretsManager::Secret" ,
41
+ "Properties" : {
42
+ "Description" : {
43
+ "Fn::Join" : [
44
+ " " ,
45
+ [
46
+ " Generated by the CDK for stack: " ,
47
+ {
48
+ "Ref" : " AWS::StackName"
49
+ }
50
+ ]
51
+ ]
52
+ },
53
+ "GenerateSecretString" : {
54
+ "ExcludeCharacters" : " %+~`#$&*()|[]{}:;<>?!'/@\"\\ " ,
55
+ "GenerateStringKey" : " password" ,
56
+ "PasswordLength" : 30 ,
57
+ "SecretStringTemplate" : " {\" username\" :\" admin\" ,\" dbname\" :\" admindb\" }"
58
+ },
59
+ "Name" : " admin-secret"
60
+ },
61
+ "UpdateReplacePolicy" : " Delete" ,
62
+ "DeletionPolicy" : " Delete"
63
+ },
64
+ "testsecretAttachment19AD251F" : {
65
+ "Type" : " AWS::SecretsManager::SecretTargetAttachment" ,
66
+ "Properties" : {
67
+ "SecretId" : {
68
+ "Ref" : " testsecretF8BBC644"
69
+ },
70
+ "TargetId" : {
71
+ "Ref" : " DatabaseB269D8BB"
72
+ },
73
+ "TargetType" : " AWS::RDS::DBCluster"
74
+ }
75
+ },
76
+ "testsecrettestscheduleEA0B5085" : {
77
+ "Type" : " AWS::SecretsManager::RotationSchedule" ,
78
+ "Properties" : {
79
+ "SecretId" : {
80
+ "Ref" : " testsecretF8BBC644"
81
+ },
82
+ "HostedRotationLambda" : {
83
+ "ExcludeCharacters" : " %+~`#$&*()|[]{}:;<>?!'/@\"\\ " ,
84
+ "RotationType" : " MySQLSingleUser"
85
+ },
86
+ "RotationRules" : {
87
+ "AutomaticallyAfterDays" : 30
88
+ }
89
+ }
90
+ },
91
+ "testsecretPolicyA5D2F46F" : {
92
+ "Type" : " AWS::SecretsManager::ResourcePolicy" ,
93
+ "Properties" : {
94
+ "ResourcePolicy" : {
95
+ "Statement" : [
96
+ {
97
+ "Action" : " secretsmanager:DeleteSecret" ,
98
+ "Effect" : " Deny" ,
99
+ "Principal" : {
100
+ "AWS" : {
101
+ "Fn::Join" : [
102
+ " " ,
103
+ [
104
+ " arn:" ,
105
+ {
106
+ "Ref" : " AWS::Partition"
107
+ },
108
+ " :iam::" ,
109
+ {
110
+ "Ref" : " AWS::AccountId"
111
+ },
112
+ " :root"
113
+ ]
114
+ ]
115
+ }
116
+ },
117
+ "Resource" : " *"
118
+ },
119
+ {
120
+ "Action" : [
121
+ " secretsmanager:DescribeSecret" ,
122
+ " secretsmanager:GetSecretValue"
123
+ ],
124
+ "Effect" : " Allow" ,
125
+ "Principal" : {
126
+ "AWS" : {
127
+ "Fn::Join" : [
128
+ " " ,
129
+ [
130
+ " arn:" ,
131
+ {
132
+ "Ref" : " AWS::Partition"
133
+ },
134
+ " :iam::" ,
135
+ {
136
+ "Ref" : " AWS::AccountId"
137
+ },
138
+ " :root"
139
+ ]
140
+ ]
141
+ },
142
+ "Service" : " ecs-tasks.amazonaws.com"
143
+ },
144
+ "Resource" : {
145
+ "Ref" : " testsecretAttachment19AD251F"
146
+ }
147
+ }
148
+ ],
149
+ "Version" : " 2012-10-17"
150
+ },
151
+ "SecretId" : {
152
+ "Ref" : " testsecretF8BBC644"
153
+ }
154
+ }
155
+ },
156
+ "DatabaseB269D8BB" : {
157
+ "Type" : " AWS::RDS::DBCluster" ,
158
+ "Properties" : {
159
+ "CopyTagsToSnapshot" : true ,
160
+ "DBClusterParameterGroupName" : " default.aurora-mysql5.7" ,
161
+ "EnableHttpEndpoint" : true ,
162
+ "Engine" : " aurora-mysql" ,
163
+ "EngineMode" : " serverless" ,
164
+ "KmsKeyId" : {
165
+ "Fn::GetAtt" : [
166
+ " DbSecurity381C2C15" ,
167
+ " Arn"
168
+ ]
169
+ },
170
+ "MasterUsername" : {
171
+ "Fn::Join" : [
172
+ " " ,
173
+ [
174
+ " {{resolve:secretsmanager:" ,
175
+ {
176
+ "Ref" : " testsecretF8BBC644"
177
+ },
178
+ " :SecretString:username::}}"
179
+ ]
180
+ ]
181
+ },
182
+ "MasterUserPassword" : {
183
+ "Fn::Join" : [
184
+ " " ,
185
+ [
186
+ " {{resolve:secretsmanager:" ,
187
+ {
188
+ "Ref" : " testsecretF8BBC644"
189
+ },
190
+ " :SecretString:password::}}"
191
+ ]
192
+ ]
193
+ },
194
+ "StorageEncrypted" : true ,
195
+ "VpcSecurityGroupIds" : []
196
+ },
197
+ "UpdateReplacePolicy" : " Snapshot" ,
198
+ "DeletionPolicy" : " Snapshot"
199
+ }
200
+ },
201
+ "Parameters" : {
202
+ "BootstrapVersion" : {
203
+ "Type" : " AWS::SSM::Parameter::Value<String>" ,
204
+ "Default" : " /cdk-bootstrap/hnb659fds/version" ,
205
+ "Description" : " Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
206
+ }
207
+ },
208
+ "Rules" : {
209
+ "CheckBootstrapVersion" : {
210
+ "Assertions" : [
211
+ {
212
+ "Assert" : {
213
+ "Fn::Not" : [
214
+ {
215
+ "Fn::Contains" : [
216
+ [
217
+ " 1" ,
218
+ " 2" ,
219
+ " 3" ,
220
+ " 4" ,
221
+ " 5"
222
+ ],
223
+ {
224
+ "Ref" : " BootstrapVersion"
225
+ }
226
+ ]
227
+ }
228
+ ]
229
+ },
230
+ "AssertDescription" : " CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
231
+ }
232
+ ]
233
+ }
234
+ }
235
+ }
0 commit comments