Skip to content

Commit

Permalink
feat(codepipeline-actions): show status reason in the pipeline for fa…
Browse files Browse the repository at this point in the history
…iled 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*
  • Loading branch information
clareliguori authored Mar 21, 2024
1 parent 8fd8ee8 commit 6d16337
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 16 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@
{
"Action": [
"cloudformation:DescribeChangeSet",
"cloudformation:DescribeStackEvents",
"cloudformation:DescribeStacks",
"cloudformation:ExecuteChangeSet"
],
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class SingletonPolicy extends Construct implements iam.IGrantable {
this.statementFor({
actions: [
'cloudformation:DescribeStacks',
'cloudformation:DescribeStackEvents',
'cloudformation:DescribeChangeSet',
'cloudformation:ExecuteChangeSet',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ describe('Pipeline Actions', () => {
{
Action: [
'cloudformation:DescribeChangeSet',
'cloudformation:DescribeStackEvents',
'cloudformation:DescribeStacks',
'cloudformation:ExecuteChangeSet',
],
Expand Down

0 comments on commit 6d16337

Please sign in to comment.