-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(core): diff and deploy print jumbled names for nested stacks but only accept hierarchical name as arguments #18724
Description
What is the problem?
The cdk command line tool's subcommands diff and deploy print weird jumbled names for nested stacks, eg. MyStackNestedStackABCD1234. Inconsistently, these subcommands only accept slash-separated hierarchical stack names such as MyStack/NestedStack.
This is a pain for example in the following workflow:
- run
cdk diff - from the output, note a subset of stacks with changes that you want to deploy. These are in format
MyStackNestedStackABCD1234,MyStackAnotherNestedStackEF567890 - write a deploy command to deploy those stacks:
cdk deploy MyStack/NestedStack MyStack/AnotherNestedStack
In step three you have to convert the jumbled names to the slash-separated format. Not a big problem for two stacks, but imagine 15 or 50. If cdk diff printed stack names in the hierarchical slash-separated format, one could simply copy-paste the stack names from cdk diff output.
Reproduction Steps
- Create a nested stack (
new NestedStack(this, 'NestedStack', {}) within a stack, calledMyStackin this example. - run
cdk diff
What did you expect to happen?
cdk diff to print the nice hierarchical name: MyStack/NestedStack
What actually happened?
cdk diff prints a jumbled name MyStackNestedStackABCD1234 which is not accepted as an argument by cdk diff or cdk deploy.
CDK CLI Version
2.9.0
Framework Version
2.9.0
Node.js Version
14.16.0
OS
Linux
Language
Typescript
Language Version
TypeScript (4.1.5)
Other information
No response