Repository navigation
feat(toolkit-lib): explain the CloudFormation resources per operation quota error - #2196
Open
DiegoOrtizS wants to merge 1 commit into
Open
DiegoOrtizS wants to merge 1 commit into
DiegoOrtizS wants to merge 1 commit into
Conversation
… quota error Since aws#1531, deploy change sets include nested stacks. When a deployment changes more than 2,500 resources across a nested stack hierarchy, change set creation fails with "Limit on the number of resources in a single stack operation exceeded". The error names a single nested stack, so it reads like a problem with that stack and gives no hint at the fix. Add context to the diagnosis saying the quota covers the whole stack hierarchy and that the change must be split into smaller deployments, and document the quota in the README. Closes aws#2191 Co-Authored-By: Claude Opus 5.5 <[email protected]>
DiegoOrtizS
requested a deployment
to
integ-approval
December 2, 2026 18:27 — with
GitHub Actions
Waiting
aws-cdk-automation
enabled auto-merge
December 2, 2026 18:30
This branch is waiting to be 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.
Closes #2191
Since #1531, the change sets that
cdk deploycreates include nested stacks. When a deployment changes more than 2,500 resources across a nested stack hierarchy, change set creation fails like this:The error names a single nested stack, so it reads like a problem with that stack, and nothing points at the fix. In #2191 we read it as a regression from #1531, and #2195 proposed
--no-include-nested-stacksto opt out of nested change sets. This PR replaces #2195.What testing showed
I deployed a synthetic hierarchy in my own account: a root stack with 6 nested stacks of 450
AWS::CloudFormation::WaitConditionHandleeach, 2,706 resources in total.--no-include-nested-stacks)--no-include-nested-stacks)So the quota counts the resources that a deployment changes, whether or not the change set includes nested stacks. Including them only makes CloudFormation report the problem before anything is touched. The opt-out would have turned a fast failure into a slow one with a rollback, so I closed #2195. Our failure came from an
aws-cdk-libupgrade that changed more than 2,500 resources at once.Change
This PR explains the error instead. When a change set fails with this quota error, the diagnosis now adds:
explainKnownErrorinlib/api/diagnosing/known-errors.ts, called fromenhanceErrorin the stack diagnoser. It returnsadditionalContext, socdk diagnoseand toolkit-lib consumers get the same context through the existingStackDiagnosistype, with no public API change.Design notes
AWS::CloudFormation::Stackresources, which the diagnoser skips on purpose (isRegularResourceEvent). Changing that would affect every nested stack failure, so I left it for a separate discussion.Testing
explainKnownError, plus diagnoser tests that a failed nested change set with this error gets the context (including the thrownDeploymentErrormessage) and that other nested change set failures don't.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
🤖 Generated with Claude Code