Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(diff): Support Change Set Diffs for Nested Stacks #28568

Open
1 of 2 tasks
comcalvi opened this issue Jan 3, 2024 · 0 comments
Open
1 of 2 tasks

(diff): Support Change Set Diffs for Nested Stacks #28568

comcalvi opened this issue Jan 3, 2024 · 0 comments
Labels
@aws-cdk/core Related to core CDK functionality cli Issues related to the CDK CLI effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1

Comments

@comcalvi
Copy link
Contributor

comcalvi commented Jan 3, 2024

Describe the feature

#28336 causes diff to create and analyze a change set to more accurately determine resource replacements. This does not support nested stacks, because #18207 inlined the nested templates into the root stack template under a special property, NestedTemplate. When we send this modified root stack template through CreateChangeSet, CFN throws Template Error: Fn::Equals cannot be partially collapsed, because the nested template includes the CDK Metadata condition (which uses Fn::Equals) in the Resources section.

Use Case

using cdk diff with nested stacks.

Proposed Solution

In the toolkit, realize that the template has nested stacks and that we want to create a change set. If so, do not call readCurrentTemplateWithNestedStacks(stack), since this mutates the stack to include the nested templates. Instead, call readCurrentTemplate(stack), which mutates the stack to only include the root stack template. Then, upload the body parameters to S3 for each nested stack (so CFN can find the updated templates for CreateChangeSet) and use each nested change set from DescribeChangeSet() in a similar way that #28336 does to determine resource replacement across the nested stacks.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

latest

Environment details (OS name and version, etc.)

all

@comcalvi comcalvi added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 3, 2024
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Jan 3, 2024
@comcalvi comcalvi added p1 effort/medium Medium work item – several days of effort and removed package/tools Related to AWS CDK Tools or CLI needs-triage This issue or PR still needs to be triaged. labels Jan 3, 2024
@pahud pahud added cli Issues related to the CDK CLI @aws-cdk/core Related to core CDK functionality labels Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality cli Issues related to the CDK CLI effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1
Projects
None yet
Development

No branches or pull requests

2 participants