cdk stack selection supports ! exclusion patterns
Introduced 2026-09-09 · score 0.93
HOW TO USE IT
When deploying selected stacks, prefix each stack pattern to exclude with `!` and quote it so the shell preserves it. CDK removes stacks matched by exclusion patterns from the selected stacks.
cdk deploy '<include-pattern>' '!<exclude-pattern>'cdk deploy '**' '!<exclude-pattern>'WHY THIS HELPS
Select CDK stacks while excluding stacks that match a pattern.
REQUIREMENTS AND LIMITATIONS
- Version: 2.1141.0
- <include-pattern>: Stack ID pattern to select. `*` matches one hierarchy level; `**` matches any depth. If only `!` patterns are supplied, they apply to every stack.
- !<exclude-pattern>: Excludes stacks matched by the pattern. Quote it so the shell preserves `!`; multiple patterns can be combined.
- --exclusively (-e): For `cdk deploy`, skips dependencies of selected stacks; use if an excluded stack is otherwise needed as a dependency.
- Prerequisite: Requires Node.js or another JavaScript runtime; minimum supported Node.js version is 18.
FIRST-PARTY EVIDENCE
- https://github.com/aws/aws-cdk-cli/releases/tag/aws-cdk%40v2.1141.0
- https://github.com/aws/aws-cdk-cli/blob/021a083d86b7186ef341fddd41f9b53fcf90c6f7/packages/aws-cdk/README.md
Check the installed version and the source before using it. Entry JSON