feat: unique change set names for diff, bootstrap and orphan - #1985
Merged
aws-cdk-automation merged 1 commit intoSep 22, 2026
Merged
Conversation
…phan
Fixed default change set names collide when operations run concurrently
against the same stack: a second operation deletes and replaces the
first one's change set.
Give ephemeral change sets unique names by default:
- diff: cdk-diff-change-set-<uuid>, reusing the uuid already generated
for the change set's ClientToken
- bootstrap: cdk-bootstrap-change-set-<uuid> when executing; --no-execute
keeps the stable default name so re-running replaces the pending
change set instead of accumulating one per run
- orphan: cdk-orphan-step{1,2,3}-<uuid>, one shared uuid per operation
so the steps stay correlated
The deploy default (cdk-deploy-change-set) is deliberately unchanged:
the prepare-change-set/execute-change-set pairing relies on it.
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1985 +/- ##
=======================================
Coverage 91.47% 91.47%
=======================================
Files 80 80
Lines 12675 12675
Branches 1792 1792
=======================================
Hits 11595 11595
Misses 1042 1042
Partials 38 38
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rix0rrr
approved these changes
Sep 22, 2026
aws-cdk-automation
deleted the
mrgrain/feat/toolkit-lib/uuid-change-set-names
branch
September 22, 2026 12:26
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.
The fixed default change set names collide when two operations run concurrently against the same stack: the second operation deletes and recreates the change set under the same name, breaking the first. For change sets that are ephemeral anyway, a unique name per operation avoids this entirely.
This gives unique default names to the change sets that are always cleaned up or executed:
cdk diff:cdk-diff-change-set-<uuid>, reusing the uuid the diff already generates for the change set'sClientToken. Diff change sets are always deleted in afinally, so nothing depends on finding them again by name. Anyone needing a deterministic name can use the--change-set-nameflag from feat(cli): support --change-set-name for cdk diff #1982.cdk bootstrap:cdk-bootstrap-change-set-<uuid>— but only when executing. With--no-executethe change set is deliberately left in review for the user, so it keeps the stable default name: re-running bootstrap then replaces the pending change set instead of accumulating one per run.cdk orphan:cdk-orphan-step{1,2,3}-<uuid>with one uuid shared by all steps of an operation, so the change sets of one orphan run stay correlated.The deploy default (
cdk-deploy-change-set) is deliberately unchanged: theprepare-change-set→execute-change-setworkflow relies on the stable name to find the change set again. Customers may use--change-set-nameto provide a custom, unique name.Because change set names are observable, a customer environments might have a condition IAM policy on them. All new names keep recognizable
cdk-*prefixes, but any exact-match policy on the old names would no longer work. I think this acceptable, the names where never a documented stable contruct. Leftover uniquely-named change sets from crashed runs are purged by CloudFormation whenever any change set is executed on the stack, so they don't accumulate indefinitely.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license