aws-cdk: cdk diff does not work with nested stacks
Running cdk diff only lists the S3 templates of the root stack as changed.
Reproduction Steps
Create a nested stack with some resources in a nested stack. Deploy the nested stack. Add more resources to nested stack.
cdk diff should report the changes in the nested stack.
Error Log
N/A
Environment
- CLI Version : 1.19.0
- Framework Version: 1.19.0
- OS : macOS
- Language : TypeScript
This is đ Bug Report
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 56
- Comments: 19 (10 by maintainers)
Commits related to this issue
- Included nested stacks when building changesets. This is a workaround for #5722 - users can do `cdk deploy --no-execute` and then view the nested changesets as a way to get a full diff of changes. — committed to rectalogic/aws-cdk by rectalogic 3 years ago
- feat(cli): `cdk diff` works for Nested Stacks (#18207) `cdk diff` now compares all template objects (Resources, Outputs, etc) across nested stacks. Closes #5722. ---- *By submitting this pull requ... — committed to aws/aws-cdk by comcalvi 2 years ago
- fix(aws-cdk): include nested stacks when building changesets (#17396) This is a workaround for #5722 - users can do `cdk deploy --no-execute` and then view the nested changesets as a way to get a ful... — committed to aws/aws-cdk by rectalogic 2 years ago
- feat(cli): `cdk diff` works for Nested Stacks (#18207) `cdk diff` now compares all template objects (Resources, Outputs, etc) across nested stacks. Closes #5722. ---- *By submitting this pull requ... — committed to TikiTDO/aws-cdk by comcalvi 2 years ago
- fix(aws-cdk): include nested stacks when building changesets (#17396) This is a workaround for #5722 - users can do `cdk deploy --no-execute` and then view the nested changesets as a way to get a ful... — committed to TikiTDO/aws-cdk by rectalogic 2 years ago
- fix(aws-cdk): include nested stacks when building changesets (#17396) This is a workaround for #5722 - users can do `cdk deploy --no-execute` and then view the nested changesets as a way to get a ful... — committed to aws/aws-cdk by rectalogic 2 years ago
- fix(aws-cdk): include nested stacks when building changesets This is a workaround for #5722 - users can do `cdk deploy --no-execute` and then view the nested changesets as a way to get a full diff of... — committed to aws/aws-cdk by rectalogic 2 years ago
- fix(aws-cdk): include nested stacks when building changesets (#19494) This is a workaround for #5722 - users can do `cdk deploy --no-execute` and then view the nested changesets as a way to get a ful... — committed to aws/aws-cdk by rix0rrr 2 years ago
- fix(aws-cdk): include nested stacks when building changesets (#19494) This is a workaround for #5722 - users can do `cdk deploy --no-execute` and then view the nested changesets as a way to get a ful... — committed to StevePotter/aws-cdk by rix0rrr 2 years ago
Hi everyone!
Sorry for not providing an update for a while. This is not currently being worked on, and currently not planed. The label
p1means it is something we want to add to the AWS CDK, and it will get a higher priority in our planing. As for the âwhenâ, I donât have an answer, we are currently focused on v2 and it is unlikely we will get to this before v2 release.@cmckni3 It does! I will look into what is required to add this to the cdk. Thanks!
Hate to needlessly bump this, but it is a pretty big problem and it is now among the top 2% most upvoted issues.
We recently completed a refactoring of some stacks and moved them into nested stacks, not knowing about this issue which turns out to be pretty blocking. What was meant to be a refactoring made us lose most of the usefulness of the cdk.
Is there any update here? Is this hard to implement? Any guidance into how it might be implemented would be helpful, perhaps I can take a look at the implementation myself.
/cc @NetaNir, @rix0rrr
In the interim, could you pass
IncludeNestedStacks: truetocreateChangeSetand then we can see the diffs in the CFN console (usingcdk deploy --no-execute)? https://github.com/aws/aws-cdk/blob/master/packages/aws-cdk/lib/api/deploy-stack.ts#L249It could at least be documented, this must be a very common problem for people building non-trivial infrastructure - AFAIK it is the ârecommendedâ way of working around the 500-resource limit. I too have implemented an architecture based around the nested stack pattern only to be surprised it does not work with core CDK functionality.
Specifically, these links seem like they should mention the limitation in a big red warning block:
NestedStackresource does not mention the limitation - https://docs.aws.amazon.com/cdk/api/latest/docs/core-readme.htmlWe are having same issue with our CDK app. Is there any update on this one, please. It will improve our dev workflow with nested stacks
any updates on this?
Using this shell script, for example, it is possible to check simple diffs.
Diff
Check
https://gist.github.com/yukiarrr/ca846d599d166c750bff5e8c8ac986f8
However, this is only a simplified version, so it is desirable to be able to check it with âcdk diffâ.
This issue, #4489, #4490 and #5974 make working with Nested Stacks in CDK much more troublesome than it should be. Is there any update on this?