fix(toolkit-lib): diff leaves a deleting shell stack behind, breaking the next deploy - #1994
Merged
aws-cdk-automation merged 1 commit intoSep 23, 2026
Conversation
mrgrain
approved these changes
Sep 23, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1993
cdk diff --method=change-setmaterialises aREVIEW_IN_PROGRESSshell stack for a stack that does not exist yet, then deletes it without waiting for the delete to complete. Acdk deploystarted shortly afterwards still sees the shell viaDescribeStacks, socanSkipDeploycallstemplate()→GetTemplate, which fails withStack [<name>] does not existbecause a deleting shell has no template. That error is not caught (lookuponly matches theStack with id <name> does not existwording), so the deploy exits 1.Deployments.cleanupChangeSetalready waits after the equivalent delete; this makescreateChangeSetAndCleanupdo the same, and applies the same fix tocreateValidationChangeSet.The wait is gated on a new
stackExistedBeforeflag rather than the existingexists, so a diff only ever waits for a shell that its own change set created.existsreports a stack inREVIEW_IN_PROGRESS/DELETE_IN_PROGRESSas absent, so gating on it would make a read-only diff block on an unrelated stack that someone else already had in flight.CreateChangeSetOptionsis module-internal (not re-exported fromlib/index.ts), so the added field is not an API change.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license