cli: let cdk diff
show nested templates also with --template
#23395
Labels
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p1
package/tools
Related to AWS CDK Tools or CLI
Describe the feature
With #18207 the CLI command
cdk diff
got support for showing changes to nested templates when comparing against a deployment. It would be nice if we could use the same feature also when comparing against a synthesized template with `--template``Use Case
In our CI/CD pipeline we want to show the changes a PR causes to the template. For this, we compare the synthesized template against the one synthesized from the base branch (using something like
cdk diff --template cdk-base.out/MyStack.template --app cdk.out --exclusively MyStack
).Unfortunately this does not show information about nested stacks except that their template has changed.
Comparing against deployment is not a viable solution, because the base branch often already contains other changes that have not yet been deployed, which would then also show up in the diff, even though they are completely unrelated.
Proposed Solution
A possible solution could be to let
--template
specify a directory (usuallycdk.out
), not only a single template. The diff algorithm would then pick up the nested stack templates and add them to the parent diff.This would perhaps also remove the necessity to use
--exclusively
to ensure only a single stack is compared.Other Information
No response
Acknowledgements
CDK version used
2.54.0
Environment details (OS name and version, etc.)
Ubuntu 22.04.1 (via Windows WSL)
The text was updated successfully, but these errors were encountered: