Skip to content

Commit 5dec01a

Browse files
AllanZhengYPskinny85
authored andcommitted
fix(aws-codepipeline): update CFN example. (#1653)
This test is referred as example in the [Cloudformation README](https://github.com/awslabs/aws-cdk/blob/master/packages/%40aws-cdk/aws-cloudformation/README.md). But the example doesn't do what it intended. Without specifying the runOrder the `pipelineExecuteChangeSetAction` will be triggered immediately without change set being populated, which will lead to deployment failure. After adding the `runOrder` the 3 actions will run in order and only be deployed after manual approval.
1 parent f08ca15 commit 5dec01a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.expected.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@
247247
"InputArtifacts": [],
248248
"Name": "ApproveChanges",
249249
"OutputArtifacts": [],
250-
"RunOrder": 1
250+
"RunOrder": 2
251251
},
252252
{
253253
"ActionTypeId": {
@@ -264,7 +264,7 @@
264264
"InputArtifacts": [],
265265
"Name": "ExecuteChanges",
266266
"OutputArtifacts": [],
267-
"RunOrder": 1
267+
"RunOrder": 3
268268
}
269269
],
270270
"Name": "Deploy"

packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,17 @@ const prodStage = {
3535
changeSetName,
3636
adminPermissions: true,
3737
templatePath: source.outputArtifact.atPath('template.yaml'),
38+
runOrder: 1,
39+
}),
40+
new codepipeline.ManualApprovalAction({
41+
actionName: 'ApproveChanges',
42+
runOrder: 2,
3843
}),
39-
new codepipeline.ManualApprovalAction({ actionName: 'ApproveChanges' }),
4044
new cfn.PipelineExecuteChangeSetAction({
4145
actionName: 'ExecuteChanges',
4246
stackName,
4347
changeSetName,
48+
runOrder: 3,
4449
}),
4550
],
4651
};

0 commit comments

Comments
 (0)