From 5dec01a11021a157ef386049c300fc4a7769318f Mon Sep 17 00:00:00 2001 From: AllanFly120 Date: Mon, 18 Feb 2019 16:59:04 -0800 Subject: [PATCH] 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. --- .../test/integ.cfn-template-from-repo.lit.expected.json | 4 ++-- .../test/integ.cfn-template-from-repo.lit.ts | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.expected.json b/packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.expected.json index 313d1a5f5ac39..dae148a9056bc 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.expected.json +++ b/packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.expected.json @@ -247,7 +247,7 @@ "InputArtifacts": [], "Name": "ApproveChanges", "OutputArtifacts": [], - "RunOrder": 1 + "RunOrder": 2 }, { "ActionTypeId": { @@ -264,7 +264,7 @@ "InputArtifacts": [], "Name": "ExecuteChanges", "OutputArtifacts": [], - "RunOrder": 1 + "RunOrder": 3 } ], "Name": "Deploy" diff --git a/packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.ts b/packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.ts index fcb20bdd3f97d..0b408ecea9fcd 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/integ.cfn-template-from-repo.lit.ts @@ -35,12 +35,17 @@ const prodStage = { changeSetName, adminPermissions: true, templatePath: source.outputArtifact.atPath('template.yaml'), + runOrder: 1, + }), + new codepipeline.ManualApprovalAction({ + actionName: 'ApproveChanges', + runOrder: 2, }), - new codepipeline.ManualApprovalAction({ actionName: 'ApproveChanges' }), new cfn.PipelineExecuteChangeSetAction({ actionName: 'ExecuteChanges', stackName, changeSetName, + runOrder: 3, }), ], };