fix(toolkit-lib): refactor ignores a custom toolkit stack name - #1791
Merged
aws-cdk-automation merged 1 commit intoJul 31, 2026
Merged
Conversation
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
iankhou
reviewed
Jul 31, 2026
iankhou
reviewed
Jul 31, 2026
mrgrain
force-pushed
the
mrgrain/fix/toolkit-lib/refactor-custom-toolkit-stack-name
branch
from
July 31, 2026 15:16
eb2d397 to
4980426
Compare
iankhou
approved these changes
Jul 31, 2026
When a refactor has to upload templates larger than 50KiB to the bootstrap staging bucket, it looked up the bootstrap stack under the default `CDKToolkit` name, so any environment bootstrapped under a custom name failed with "Template too large to refactor". The bootstrap version check had the same problem and silently skipped itself. Thread the toolkit stack name through the refactor action, and accept `--toolkit-stack-name` on `cdk refactor`. Fixes #1790
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 #1790
cdk refactorfailed withTemplate too large to refactor ("cdk bootstrap" is required)in environments bootstrapped under a custom toolkit stack name, even though they were bootstrapped correctly. Refactoring a template larger than 50KiB has to upload it to the bootstrap staging bucket, and that lookup always searched forCDKToolkit, ignoring both--toolkit-stack-nameandtoolkitStackNameincdk.json. The same blind spot silently disabled the bootstrap version check, so a bootstrap stack too old to refactor was only caught later, inside CloudFormation.cdk refactornow also accepts--toolkit-stack-name, which was rejected here whiledeploy,importandbootstrapall accept it.Both of these now work as you'd expect: point
cdk refactorat a custom-named bootstrap stack, by flag or config, and large templates are staged in the right bucket.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license