Skip to content

feat(toolkit-lib): support CloudFormation rollback triggers - #1881

Open
mattmb-aws wants to merge 1 commit into
aws:mainfrom
mattmb-aws:feat/5170-rollback-triggers
Open

feat(toolkit-lib): support CloudFormation rollback triggers#1881
mattmb-aws wants to merge 1 commit into
aws:mainfrom
mattmb-aws:feat/5170-rollback-triggers

Conversation

@mattmb-aws

Copy link
Copy Markdown

Expose CloudFormation rollback triggers (rollback alarms + monitoring time) so a stack create/update is automatically rolled back when a CloudWatch alarm breaches.

  • toolkit-lib: new public rollbackConfiguration deploy option (RollbackConfiguration/RollbackTrigger/RollbackTriggerType). It is validated (<=5 triggers, valid alarm ARNs, 0-180 min) and threaded through to the Create/Update/CreateChangeSet calls, with change detection so an unchanged config does not force a deployment.
  • cli: new cdk deploy --rollback-trigger-alarm-arns and --monitoring-time-minutes flags. CLI ARNs default to metric alarms; composite alarms are reachable via the programmatic API.

Follows the same undefined/[]/[...] management semantics as notificationArns.

Fixes aws/aws-cdk#5170

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Fixes #

Checklist

  • This change contains a major version upgrade for a dependency and I confirm all breaking changes are addressed
    • Release notes for the new version:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@codecov-commenter

codecov-commenter commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.08%. Comparing base (7ff50e7) to head (bd51232).

Files with missing lines Patch % Lines
packages/aws-cdk/lib/cli/cli.ts 60.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1881      +/-   ##
==========================================
- Coverage   91.10%   91.08%   -0.02%     
==========================================
  Files          80       80              
  Lines       12205    12233      +28     
  Branches     1742     1744       +2     
==========================================
+ Hits        11119    11143      +24     
- Misses       1050     1054       +4     
  Partials       36       36              
Flag Coverage Δ
suite.unit 91.08% <86.66%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Expose CloudFormation rollback triggers (rollback alarms + monitoring
time) so a stack create/update is automatically rolled back when a
CloudWatch alarm breaches.

- toolkit-lib: new public `rollbackConfiguration` deploy option
  (RollbackConfiguration/RollbackTrigger/RollbackTriggerType). It is
  validated (<=5 triggers, valid alarm ARNs, 0-180 min) and threaded
  through to the Create/Update/CreateChangeSet calls, with change
  detection so an unchanged config does not force a deployment.
- cli: new `cdk deploy --rollback-trigger-alarm-arns` and
  `--monitoring-time-minutes` flags. CLI ARNs default to metric alarms;
  composite alarms are reachable via the programmatic API.

Follows the same undefined/[]/[...] management semantics as
notificationArns.

Fixes aws/aws-cdk#5170

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
@mattmb-aws
mattmb-aws force-pushed the feat/5170-rollback-triggers branch from 085e00f to bd51232 Compare August 22, 2026 15:17
@mattmb-aws
mattmb-aws marked this pull request as ready for review August 22, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support CloudFormation rollback triggers

2 participants