(deploy): improve deployment failure reporting using CloudFormation `FailedEvents` filter
- Dominant language
- TypeScript
- Stars
- 105
- Forks
- 122
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 71
Description
### Describe the feature
CloudFormation recently released a new feature for the `DescribeEvents` API that allows filtering events by root cause (`FailedEvents=true`) and grouping them by `OperationId`.
Currently, when a CDK deployment fails, the CLI outputs a large number of events, making it difficult to visually scan for the actual error that caused the rollback.
The new API capability is described here:
[Accelerate infrastructure development with CloudFormation pre-deployment validation and simplified troubleshooting](https://aws.amazon.com/blogs/devops/accelerate-infrastructure-development-with-cloudformation-pre-deployment-validation-and-simplified-troubleshooting/)
### Use Case
When deploying stacks with `cdk deploy`, you may encounter deployment failures. Finding the root cause currently requires scrolling through a long history of `UPDATE_IN_PROGRESS` and `UPDATE_COMPLETE` events to find the one `CREATE_FAILED` or `UPDATE_FAILED` event that triggered the rollback.
If the CLI utilized the new `FailedEvents=true` filter, it could immediately present the specific error(s) at the bottom of the log output, significantly reducing the time required to debug deployment issues.
### Proposed Solution
_No response_
### Other Information
_No response_
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.223.0
### Environment details (OS name and version, etc.)
Ubuntu 24.04
Contributor guide
Assessment
This issue has not been assessed yet.