-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
NestedStack: more mening full diff log output #20392
Comments
Bump. This has been an issue for-e-ver. It's the reason we moved away from NestedStacks in CloudFormation years ago because it's similar there. You have to bend over backward to get the diffs to see the actual changes, it's like a black box waiting to explode your production environment with a resource replacement you weren't expecting. |
Agreed... gotta bump this too, nested stack diff'ing is critical especially with a tool like CDK. |
@rectalogic - I tried using version 2.38.1, which I had installed & it didn't work. I also tried installing 2.19.0, which also did not work. Here is my test code:
Running
I wanted to note that this is a new stack that I don't have deployed to my AWS account. Could that be an issue i.e. that nested stack diff doesn't work until a version of the nested stack is deployed? |
Yup - it appears that the issue is that We're going to try working around the issue by first deploying an empty nested stack prior to adding resources to it. |
@ErrorsAndGlitches deploying the empty nested stack first produced the detailed diff? |
@comcalvi yup. I created an empty stack, deployed, & then updated the nested stack code to have an S3 bucket. The diff then produced:
We're trying the approach for our production stacks now. Will see if it works. |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
I would also like the diff to be more similar to regular stack diffs. The diff for nested stacks are hiding important details that makes it harder to decide whether the change is a danger to the production environment or not. |
I'm trying to use aws_cdk.pipelines.ConfirmPermissionsBroadening, which shows the broadening permission changes in a stack. However, when I have nested stacks the permission changes do not show up in "cdk diff" called by "ConfirmPermissionsBroadening". Making the "cdk diff" work for nested stacks should solve this issue. I have a minimal stack here for testing this: |
+1 |
Any plans to fix that? |
For anyone experiencing that nested stacks do not show up when running diff: I did some digging and have come to the conclusion that |
Looks like this still isn't fixed (at least for deploying a new stack). Nested stack output:
vs Regular Stack output
So yeah, looks like the |
Yes, this has been my experience as well. |
Ok, sounds about right. I'll keep this thread pinned for a few more years while we wait for the real fix to be implemented. :-) And I'll continue to prefer Stack over NestedStack. |
Describe the feature
Need a way to get diff logs out for NestedStack before i deploy CDK code to AWS
Use Case
Today when you are using multi-stacks in your CDK code its showing the diff before you will deploy, when you start using NestedStack this diff become very problematic becures its only referac til the NestedStach hash and not the full diff list over changes inside NestedStacks
The biggest issue here its if you don't can get this logs out you are working in a huge black-box when you are using NestedStack.
Proposed Solution
Solution num 1:
Use the diff log hash-key for NestedStack resoruces to read the changes out
cdk diff --nestedStackHash {diff-hash-key}
Solution num 2:
sending falg with to return all NestedStack logs back in the console
cdk diff --includeNestedStackLog
Solution num 3:
Support NestedStack with full output to json file so its can be manally parsed.
cdk diff --dumpFullJsonLog --includeNestedStack
Other Information
No response
Acknowledgements
CDK version used
2.24.1 (build 585f9ca)
Environment details (OS name and version, etc.)
macOS 12.3.1
The text was updated successfully, but these errors were encountered: