- Newest
- Most votes
- Most comments
Hi,
Stacks created by CDK may have cross-dependencies.
See https://medium.com/life-at-apollo-division/resolve-aws-cdk-stack-dependency-conflicts-c6a3dee0c28d
So, the order of their destruction matters if you want to end up with a clean situation: i.e all resources created automatically by the stacks also get destroyed automatically. You don't want to keep some resources active because stacks were deleted in incorrect order.
That is why CDK give us less control on stack destruction, in particular in parallel.
Best,
Didier
Hello.
I think if you add "--all" to the option, all stacks will be deleted.
Also, doesn't it work if you surround the wildcard with quotes?
https://docs.aws.amazon.com/cdk/v2/guide/cli.html#cli-stacks
You may also use the --all option to specify all stacks.
When using wildcards, enclose the pattern in quotes, or escape the wildcards with . If you don't, your shell may try to expand the pattern to the names of files in the current directory. At best, this won't do what you expect; at worst, you could deploy stacks you didn't intend to. This isn't strictly necessary on Windows because cmd.exe does not expand wildcards, but is good practice nonetheless.
Thanks, for your suggestion, but unfortunately it doesn't address my use case.
Firstly, the wildcard matching is working, and does destroy all stacks that match the pattern, but not concurrently.
Secondly, I don't want to destroy all stacks, which the -all option would do, just those that match my pattern.
Relevant content
- asked 3 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a year ago
Thanks Didier.
I understand what you are saying though i'm a little surprised by it. It's certainly true that I have stack dependencies, but when deploying, the CDK must understand those dependencies to an extent as it can deploy independent stacks concurrently, so why can't it also do so when destroying?