(deploy): --express --rollback fails any changed nested stack: CloudFormation creates the nested change set with DisableRollback: true
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- aws, typescript
Hướng nghiên cứu
Start in deploy-stack.ts by reading deployConfig() and commonExecuteOptions(), then reproduce the nested-stack failure with cdk deploy --express --rollback and inspect the resulting change set. Compare the possible CLI behaviors described in the issue, including omitting IncludeNestedStacks or falling back to direct deployment. Done means the selected behavior avoids the DisableRollback conflict while preserving the documented deployment expectations.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
With the default change-set method, cdk deploy --express --rollback fails whenever a nested stack has changes, on create as well as on update. The nested stack resource fails with:
Express mode deployment failed with: DisableRollback specified on ExecuteChangeSet conflicts with the value DisableRollback the ChangeSet was created with.
The parent then rolls back. Stacks without nested stacks, and parents whose nested stacks are unchanged, deploy fine with the same flags.
Cause. CloudFormation propagates only part of the parent's DeploymentConfig to the nested change sets. In 2.1144.0 the CLI calls CreateChangeSet with IncludeNestedStacks: true and DeploymentConfig: { Mode: "EXPRESS", DisableRollback: false } (deployConfig() in deploy-stack.ts). DescribeChangeSet on the result shows:
parent change set: "DeploymentConfig": { "Mode": "EXPRESS", "DisableRollback": false }
nested change set: "DeploymentConfig": { "Mode": "EXPRESS", "DisableRollback": true }
So the nested change set gets Mode from the parent but Express's default DisableRollback: true, and executing the parent with rollback enabled conflicts with it. The CLI's ExecuteChangeSet carries no DisableRollback (commonExecuteOptions() only adds DisableRollback: true when rollback === false). Executing the same parent change set with an explicit --no-disable-rollback fails the same way, so nothing the CLI sends at execute time avoids it.
The Express mode docs say Express "propagates to all nested stacks in the hierarchy" and works with change sets, and they document disableRollback: false as the way to re-enable rollback. Together those mean this combination should work. The root bug is in CloudFormation. I'm filing it here because CDK users hit it through cdk deploy, --express --rollback is what #1969 / #1970 recommend for replacements, and the CLI can work around it (see Possible Solution).
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
The parent and its nested stacks deploy in Express mode with rollback enabled, as they do with --method=direct.
Current Behavior
The changed nested stack fails with the message above and the parent rolls back. In a real app with two changed nested stacks, the first one failed with that message and the second, which started a second later, failed with Express mode deployment failed with: Resource update cancelled:
UPDATE_IN_PROGRESS AWS::CloudFormation::Stack <parent> User Initiated
UPDATE_COMPLETE AWS::Lambda::Function ... Resource operation completed using Express Mode. ...
UPDATE_IN_PROGRESS AWS::CloudFormation::Stack <NestedA>.NestedStackResource
UPDATE_FAILED AWS::CloudFormation::Stack <NestedA>.NestedStackResource Express mode deployment failed with: DisableRollback specified on ExecuteChangeSet conflicts with the value DisableRollback the ChangeSet was created with.
UPDATE_IN_PROGRESS AWS::CloudFormation::Stack <NestedB>.NestedStackResource
UPDATE_FAILED AWS::CloudFormation::Stack <NestedB>.NestedStackResource Express mode deployment failed with: Resource update cancelled
UPDATE_ROLLBACK_IN_PROGRESS AWS::CloudFormation::Stack <parent> The following resource(s) failed to update via Express Mode: [<NestedB>, <NestedA>].
UPDATE_ROLLBACK_COMPLETE AWS::CloudFormation::Stack <parent>
❌ <parent> failed to deploy
DeploymentError: The stack named <parent> failed to deploy: UPDATE_ROLLBACK_COMPLETE
Reproduction Steps
Unpatched CLI 2.1144.0, aws-cdk-lib 2.272.0, eu-north-1:
// app.js — cdk.json: { "app": "node app.js" }
const cdk = require('aws-cdk-lib');
const ssm = require('aws-cdk-lib/aws-ssm');
const v = process.env.V || '1';
const app = new cdk.App();
const parent = new cdk.Stack(app, 'Repro', { env: { region: 'eu-north-1' } });
new ssm.StringParameter(parent, 'ParentParam', { stringValue: 'parent-' + v });
const nested = new cdk.NestedStack(parent, 'Child');
new ssm.StringParameter(nested, 'ChildParam', { stringValue: 'child-' + (process.env.C || v) });
| Command | Result |
|---|---|
cdk deploy --express --rollback (stack doesn't exist yet) |
❌ CREATE fails with the message, ROLLBACK_COMPLETE |
cdk deploy --express (create, then update) |
✅ |
V=2 cdk deploy --express --rollback --no-execute, then DescribeChangeSet |
nested change set has DisableRollback: true (above) |
execute that change set with aws cloudformation execute-change-set --no-disable-rollback |
❌ same message |
V=6 C=5 cdk deploy --express --rollback (only the parent changes) |
✅ |
V=6 C=7 cdk deploy --express --rollback (only the nested stack changes) |
❌ same message |
cdk deploy --express --rollback --method=direct |
✅ |
cdk deploy (standard mode, change set) |
✅ |
CreateChangeSet with the same template and DeploymentConfig, without IncludeNestedStacks, then ExecuteChangeSet |
✅ nested stack updated in Express mode |
Workaround: cdk deploy --express --rollback --method=direct.
Possible Solution
On the CloudFormation side: give nested change sets the parent's full DeploymentConfig, including DisableRollback.
In the CLI, until then: when express and rollback are both set, create the change set without IncludeNestedStacks. That worked in the last row above. The cost is that the diff and approval prompt no longer show the nested stacks' resource changes, and replacements inside nested stacks aren't detected before execution. Falling back to --method=direct in that case, or warning, would also work.
Additional Information/Context
Related: #1931 (Express without rollback can't deploy replacements, so --rollback is needed), #1969, #1970. Together with this issue, --express --rollback --method=direct is the only Express combination that works today for a stack with both a replacement and changed nested stacks.
CDK CLI Version
2.1144.0 (the minimal repro is unpatched; the original failure was on 2.1144.0 with a local patch for #2013 that only touches the skip check)
Framework Version
aws-cdk-lib 2.272.0
Node.js Version
24.15.0 (original failure), 24.13.0 (repro)
OS
macOS (repro), Linux (original failure, GitHub Actions self-hosted runner)
Language
TypeScript
- Ngôn ngữ chính
- TypeScript
- Star
- 110
- Fork
- 138
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 55
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws/aws-cdk-cli
-
aws-cdk bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws/aws-cdk-cli#2179 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
(cli): deploy waits forever when an AWS API call gets no response, because requestTimeout only logs a warningCó thể đã có người làm @abhiramshaji-cyber đã nhận 27 ngày trước. Đang mởaws-cdk bug p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws/aws-cdk-cli#2097 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
(bootstrap) FilePublishingRoleDefaultPolicy permission incorrect when FileAssetsBucketKmsKeyId is an ARN valueCó thể đã có người làm @lemon0333 đã nhận 95 ngày trước. Đang mởbug p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
aws/aws-cdk-cli#921 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
(garbage-collection): cdk gc takes hours on a large bootstrap bucketCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
aws/aws-cdk-cli#2165 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
(cli): cdk flags --set always reports no template differences before applying flagsCó thể đã có người làm @go-to-k đã nhận 10 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
aws/aws-cdk-cli#2153 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aws/aws-cdk-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
GetStream/stream-chat-react#3467 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
vercel-labs/ui#1139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Có thể đã có người làm @goranai đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] IntegerRange.contains counts a non-integer just above max as inside an inclusive rangeĐang mởbot:ai-assisted component:platform-js status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
midnightntwrk/platform-js#93 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100