@@ -60,6 +60,7 @@ Object {
6060 Object {
6161 " Action" : Array [
6262 " ecs:RegisterTaskDefinition" ,
63+ " ecs:DescribeTaskDefinition" ,
6364 " ecs:DeregisterTaskDefinition" ,
6465 ],
6566 " Effect" : " Allow" ,
@@ -116,6 +117,178 @@ Object {
116117 " Arn" ,
117118 ],
118119 },
120+ " Update" : " {\\ " service \\" :\\ " ECS \\" ,\\ " action \\" :\\ " describeTaskDefinition \\" ,\\ " parameters \\" :{\\ " taskDefinition \\" :\\ " PHYSICAL :RESOURCEID :\\" },\\ " physicalResourceId \\" :{\\ " responsePath \\" :\\ " taskDefinition .taskDefinitionArn \\" }}" ,
121+ },
122+ " Type" : " Custom::DummyTaskDefinition" ,
123+ " UpdateReplacePolicy" : " Delete" ,
124+ } ,
125+ "DummyTaskDefinitionExecutionRole715DBD43": Object {
126+ " Properties" : Object {
127+ " AssumeRolePolicyDocument" : Object {
128+ " Statement" : Array [
129+ Object {
130+ " Action" : " sts:AssumeRole" ,
131+ " Effect" : " Allow" ,
132+ " Principal" : Object {
133+ " Service" : " ecs-tasks.amazonaws.com" ,
134+ },
135+ },
136+ ],
137+ " Version" : " 2012-10-17" ,
138+ },
139+ " ManagedPolicyArns" : Array [
140+ Object {
141+ " Fn::Join" : Array [
142+ " " ,
143+ Array [
144+ " arn:" ,
145+ Object {
146+ " Ref" : " AWS::Partition" ,
147+ },
148+ " :iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy" ,
149+ ],
150+ ],
151+ },
152+ ],
153+ },
154+ " Type" : " AWS::IAM::Role" ,
155+ } ,
156+ },
157+ }
158+ `;
159+
160+ exports[`with updates allowed 1`] = `
161+ Object {
162+ " Parameters" : Any <Object >,
163+ "Resources": Object {
164+ " AWS679f53fac002430cb0da5b7982bd22872D164C4C" : Object {
165+ " DependsOn" : Array [
166+ " AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" ,
167+ ],
168+ " Properties" : Object {
169+ " Code" : Any <Object >,
170+ "Handler": "index.handler",
171+ "Role": Object {
172+ " Fn::GetAtt" : Array [
173+ " AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" ,
174+ " Arn" ,
175+ ],
176+ } ,
177+ "Runtime": "nodejs12.x",
178+ "Timeout": 120,
179+ },
180+ "Type": "AWS::Lambda::Function",
181+ },
182+ "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": Object {
183+ " Properties" : Object {
184+ " AssumeRolePolicyDocument" : Object {
185+ " Statement" : Array [
186+ Object {
187+ " Action" : " sts:AssumeRole" ,
188+ " Effect" : " Allow" ,
189+ " Principal" : Object {
190+ " Service" : " lambda.amazonaws.com" ,
191+ },
192+ },
193+ ],
194+ " Version" : " 2012-10-17" ,
195+ },
196+ " ManagedPolicyArns" : Array [
197+ Object {
198+ " Fn::Join" : Array [
199+ " " ,
200+ Array [
201+ " arn:" ,
202+ Object {
203+ " Ref" : " AWS::Partition" ,
204+ },
205+ " :iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" ,
206+ ],
207+ ],
208+ },
209+ ],
210+ },
211+ " Type" : " AWS::IAM::Role" ,
212+ } ,
213+ "DummyTaskDefinitionCustomResourcePolicyB5660701": Object {
214+ " Properties" : Object {
215+ " PolicyDocument" : Object {
216+ " Statement" : Array [
217+ Object {
218+ " Action" : Array [
219+ " ecs:RegisterTaskDefinition" ,
220+ " ecs:DescribeTaskDefinition" ,
221+ " ecs:DeregisterTaskDefinition" ,
222+ ],
223+ " Effect" : " Allow" ,
224+ " Resource" : " *" ,
225+ },
226+ Object {
227+ " Action" : " iam:PassRole" ,
228+ " Effect" : " Allow" ,
229+ " Resource" : Object {
230+ " Fn::GetAtt" : Array [
231+ " DummyTaskDefinitionExecutionRole715DBD43" ,
232+ " Arn" ,
233+ ],
234+ },
235+ },
236+ ],
237+ " Version" : " 2012-10-17" ,
238+ },
239+ " PolicyName" : " DummyTaskDefinitionCustomResourcePolicyB5660701" ,
240+ " Roles" : Array [
241+ Object {
242+ " Ref" : " AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" ,
243+ },
244+ ],
245+ },
246+ " Type" : " AWS::IAM::Policy" ,
247+ } ,
248+ "DummyTaskDefinitionE3D9D432": Object {
249+ " DeletionPolicy" : " Delete" ,
250+ " DependsOn" : Array [
251+ " DummyTaskDefinitionCustomResourcePolicyB5660701" ,
252+ ],
253+ " Properties" : Object {
254+ " Create" : Object {
255+ " Fn::Join" : Array [
256+ " " ,
257+ Array [
258+ " {\\ " service \\" :\\ " ECS \\" ,\\ " action \\" :\\ " registerTaskDefinition \\" ,\\ " parameters \\" :{\\ " requiresCompatibilities \\" :[\\ " FARGATE \\" ],\\ " family \\" :\\ " c86e1e5d419d3c124c7e40411b7e7805f91621e162 \\" ,\\ " executionRoleArn \\" :\\ " " ,
259+ Object {
260+ " Fn::GetAtt" : Array [
261+ " DummyTaskDefinitionExecutionRole715DBD43" ,
262+ " Arn" ,
263+ ],
264+ },
265+ " \\ " ,\\" networkMode\\ " :\\" awsvpc\\ " ,\\" cpu\\ " :\\" 256\\ " ,\\" memory\\ " :\\" 512\\ " ,\\" containerDefinitions\\ " :[{\\" name\\ " :\\" sample-website\\ " ,\\" image\\ " :\\" image\\ " ,\\" portMappings\\ " :[{\\" hostPort\\ " :80 ,\\" protocol\\ " :\\" tcp\\ " ,\\" containerPort\\ " :80 }]}]},\\" physicalResourceId\\ " :{\\" responsePath\\ " :\\" taskDefinition.taskDefinitionArn\\ " }}" ,
266+ ],
267+ ],
268+ },
269+ " Delete" : " {\\ " service \\" :\\ " ECS \\" ,\\ " action \\" :\\ " deregisterTaskDefinition \\" ,\\ " parameters \\" :{\\ " taskDefinition \\" :\\ " PHYSICAL :RESOURCEID :\\" }}" ,
270+ " InstallLatestAwsSdk" : true ,
271+ " ServiceToken" : Object {
272+ " Fn::GetAtt" : Array [
273+ " AWS679f53fac002430cb0da5b7982bd22872D164C4C" ,
274+ " Arn" ,
275+ ],
276+ },
277+ " Update" : Object {
278+ " Fn::Join" : Array [
279+ " " ,
280+ Array [
281+ " {\\ " service \\" :\\ " ECS \\" ,\\ " action \\" :\\ " registerTaskDefinition \\" ,\\ " parameters \\" :{\\ " requiresCompatibilities \\" :[\\ " FARGATE \\" ],\\ " family \\" :\\ " c86e1e5d419d3c124c7e40411b7e7805f91621e162 \\" ,\\ " executionRoleArn \\" :\\ " " ,
282+ Object {
283+ " Fn::GetAtt" : Array [
284+ " DummyTaskDefinitionExecutionRole715DBD43" ,
285+ " Arn" ,
286+ ],
287+ },
288+ " \\ " ,\\" networkMode\\ " :\\" awsvpc\\ " ,\\" cpu\\ " :\\" 256\\ " ,\\" memory\\ " :\\" 512\\ " ,\\" containerDefinitions\\ " :[{\\" name\\ " :\\" sample-website\\ " ,\\" image\\ " :\\" image\\ " ,\\" portMappings\\ " :[{\\" hostPort\\ " :80 ,\\" protocol\\ " :\\" tcp\\ " ,\\" containerPort\\ " :80 }]}]},\\" physicalResourceId\\ " :{\\" responsePath\\ " :\\" taskDefinition.taskDefinitionArn\\ " }}" ,
289+ ],
290+ ],
291+ },
119292 },
120293 " Type" : " Custom::DummyTaskDefinition" ,
121294 " UpdateReplacePolicy" : " Delete" ,
0 commit comments