Skip to content

Commit 6d16337

Browse files
authored
feat(codepipeline-actions): show status reason in the pipeline for failed change set executions (#29534)
### Reason for this change The CodePipeline ExecuteChangeSet action can now show a summary of why the change set execution failed. But, it needs an additional IAM permission: `cloudformation:DescribeStackEvents`. With the current action policy generated by CDK, I get the following message in the pipeline when a change set execution fails: ``` Additional Information: Failed to execute change set. Current stack status: UPDATE_ROLLBACK_COMPLETE. Status reason is not available because IAM role associated with the action does not have CloudFormation DescribeStackEvents permission ``` ### Description of changes Added `cloudformation:DescribeStackEvents` permission to the policy generated for the ChangeSetExecute pipeline action. ### Description of how you validated changes Updated unit tests and integ test with the new permission. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 8fd8ee8 commit 6d16337

File tree

8 files changed

+26
-16
lines changed

8 files changed

+26
-16
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.js.snapshot/aws-cdk-codepipeline-cloudformation.assets.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.js.snapshot/aws-cdk-codepipeline-cloudformation.template.json

+1
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@
795795
{
796796
"Action": [
797797
"cloudformation:DescribeChangeSet",
798+
"cloudformation:DescribeStackEvents",
798799
"cloudformation:DescribeStacks",
799800
"cloudformation:ExecuteChangeSet"
800801
],

packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.js.snapshot/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.js.snapshot/integ.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.js.snapshot/manifest.json

+8-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.js.snapshot/tree.json

+10-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/aws-cdk-lib/aws-codepipeline-actions/lib/cloudformation/private/singleton-policy.ts

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class SingletonPolicy extends Construct implements iam.IGrantable {
3737
this.statementFor({
3838
actions: [
3939
'cloudformation:DescribeStacks',
40+
'cloudformation:DescribeStackEvents',
4041
'cloudformation:DescribeChangeSet',
4142
'cloudformation:ExecuteChangeSet',
4243
],

packages/aws-cdk-lib/aws-codepipeline-actions/test/cloudformation/pipeline-actions.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ describe('Pipeline Actions', () => {
163163
{
164164
Action: [
165165
'cloudformation:DescribeChangeSet',
166+
'cloudformation:DescribeStackEvents',
166167
'cloudformation:DescribeStacks',
167168
'cloudformation:ExecuteChangeSet',
168169
],

0 commit comments

Comments
 (0)