Skip to content

(deploy): allow opting out of IncludeNestedStacks on deploy change sets (large nested hierarchies hit "Limit on the number of resources in a single stack operation exceeded") #2191

Backlog

Description

@DiegoOrtizS

Describe the feature

Provide a way to create deploy change sets without IncludeNestedStacks: true while keeping --method=change-set. For example, a --no-include-nested-stacks flag or a cdk.json setting.

Use case

Since #1531, cdk deploy creates change sets with IncludeNestedStacks: true. We have an app with one root stack, ~30 nested stacks, and more than 3,000 resources across the hierarchy. For that app, change set creation fails:

Limit on the number of resources in a single stack operation exceeded

The CloudFormation quota of 2,500 resources per stack operation across a nested hierarchy cannot be raised. Pinning the CLI and library back to the previous versions restored deploys.

The current workarounds all have a significant cost:

Proposed solution

Either of these would work:

Other information

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Activity

  1. added a commit that references this issue on Dec 2, 2026
    6bec605
  2. DiegoOrtizS commented on Dec 2, 2026

    @DiegoOrtizS
    Author

    Update after testing: the opt-out I proposed in #2195 wouldn't help, so I closed it and opened #2196, which explains the error instead.

    I deployed a synthetic hierarchy (a root stack with 6 nested stacks, 2,706 resources) in my own account. Small changes deploy fine with the default IncludeNestedStacks: true. A deployment that changes 2,600 resources fails either way: at change set creation with nested change sets, or during execution (followed by a rollback of every nested stack) without them. So the 2,500 quota counts the resources a deployment changes, and including nested stacks only makes CloudFormation report it before anything is touched. Full results are in #2196.

    Our failure came from the aws-cdk-lib upgrade changing more than 2,500 resources at once, not from #1531. What would have saved us time is an error that says so, which is what #2196 adds.

    Workaround for anyone who hits this: split the change into several deployments that each change fewer than 2,500 resources, for example by upgrading aws-cdk-lib in smaller steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions