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

(core): Add IncludeNestedStacks option to createChangeSet #19224

Open
1 of 2 tasks
konstantinj opened this issue Mar 3, 2022 · 15 comments · Fixed by #19494
Open
1 of 2 tasks

(core): Add IncludeNestedStacks option to createChangeSet #19224

konstantinj opened this issue Mar 3, 2022 · 15 comments · Fixed by #19494
Labels
@aws-cdk/core Related to core CDK functionality effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1

Comments

@konstantinj
Copy link

Description

As @rectalogic points out here #5722 (comment) a year ago it is helpful to see the exact changes of nested stacks in the aws console. Without that option you only see that a nested stack will change. With that option you'll get a link in the console to the changeset of the nested stacks. This would be very helpful for me. I even think setting IncludeNestedStacks: true as default does not harm.

Use Case

It's currently impossible to see changes of nested stacks even when using changesets.

Proposed Solution

You need to add IncludeNestedStacks: true here:

const changeSet = await cfn.createChangeSet({

Other information

No response

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@konstantinj konstantinj added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 3, 2022
@github-actions github-actions bot added the @aws-cdk/core Related to core CDK functionality label Mar 3, 2022
@rectalogic
Copy link
Contributor

#17396 does this

@konstantinj
Copy link
Author

ok thanks. Unfortunately #19044 happened.

@konstantinj
Copy link
Author

So is there a plan to bring this option back in?

@rix0rrr rix0rrr added effort/small Small work item – less than a day of effort p1 and removed needs-triage This issue or PR still needs to be triaged. labels Mar 7, 2022
@rix0rrr rix0rrr assigned rix0rrr and unassigned rix0rrr Mar 7, 2022
@mergify mergify bot closed this as completed in #19494 Mar 29, 2022
mergify bot pushed a commit that referenced this issue Mar 29, 2022
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.

This PR is a re-roll of #17396. That PR broke an integration test in the CLI,
which this version fixes.

Closes #19224.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@madeline-k
Copy link
Contributor

Re-opening this issue since the change did not make it to release. It was reverted a few times due to causing failures in our CI integration tests.

@madeline-k madeline-k reopened this Apr 8, 2022
StevePotter pushed a commit to StevePotter/aws-cdk that referenced this issue Apr 27, 2022
This is a workaround for aws#5722 - users can do `cdk deploy --no-execute`
and then view the nested changesets as a way to get a full diff of
changes.

This PR is a re-roll of aws#17396. That PR broke an integration test in the CLI,
which this version fixes.

Closes aws#19224.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@rix0rrr rix0rrr removed their assignment May 20, 2022
@nicou
Copy link

nicou commented Jul 12, 2022

Any updates on this? I'm currently working on migrating my project to aws-cdk v2, and getting a reliable diff on nested stack resources would be really useful 😅

@aaa-khoa
Copy link

I'm getting s3 access errors on my nested stack whenever I do cross-account deploys and was wondering if this was the issue

@diranged
Copy link

Just chiming in here... it's been a while, but this would be hugely helpful. Without this, we're hesitant to make too much use of nested stacks

@konstantinj
Copy link
Author

still no action here? Unfortunately my workaround doesn't work anymore:

sed -i "s/ChangeSetName: changeSetName,/ChangeSetName: changeSetName,IncludeNestedStacks: true,/g" node_modules/aws-cdk/lib/api/deploy-stack.js
sed -i "s/ChangeSetName: changeSetName,/ChangeSetName: changeSetName,IncludeNestedStacks: true,/g" node_modules/aws-cdk/lib/index.js

doing that did the trick for me. But it looks like something has changed in the recent versions. I am on 2.70.0 now and I don't get the netested changes anymore.

Will investigate that later. It sucks not knowing what might change in a nested stack exactly.

@gagipro
Copy link

gagipro commented Apr 30, 2023

I discover this and it's a bit kind of show stopper because I was planning to use --no-execute to review changes but if cannot see what changes there are in a changeset, I really don't understand.

@gagipro
Copy link

gagipro commented May 1, 2023

sed -i "s/ChangeSetName: changeSetName,/ChangeSetName: changeSetName,IncludeNestedStacks: true,/g" node_modules/aws-cdk/lib/api/deploy-stack.js
sed -i "s/ChangeSetName: changeSetName,/ChangeSetName: changeSetName,IncludeNestedStacks: true,/g" node_modules/aws-cdk/lib/index.js

I don't understand

this code is working perfectly :
const changeSet = await this.cfn.createChangeSet({
StackName: this.stackName,
ChangeSetName: changeSetName,
ChangeSetType: this.options.resourcesToImport ? 'IMPORT' : this.update ? 'UPDATE' : 'CREATE',
IncludeNestedStacks: true,
ResourcesToImport: this.options.resourcesToImport,
Description: CDK Changeset for execution ${this.uuid},
ClientToken: create${this.uuid},

just need to add the IncludeNestedStacks: true,

why do we should have to patch with sed.

thanks @konstantinj for sharing your tip.

This must be addressed by the CDK DEV team if it doesn't introduced unexpected behavior or regression.

this https://github.com/aws/aws-cdk/pull/19494/files/120c7196153b601203e9e26709733722905657fe doesn't seem to be merged.

@peterwoodworth
Copy link
Contributor

As mentioned above, this was merged and reverted before release because it was causing errors in our CI. I'm not sure why this caused errors in our CI before, maybe @madeline-k or someone else knows about that, all I can see is that it caused an error unexpectedly in one of our CLI integ tests #19618. I'm not sure what investigation, if any, has continued here.

We would probably take another look at this sooner than later if someone helps us by submitting a PR for this

@gagipro
Copy link

gagipro commented May 1, 2023

As mentioned above, this was merged and reverted before release because it was causing errors in our CI. I'm not sure why this caused errors in our CI before, maybe @madeline-k or someone else knows about that, all I can see is that it caused an error unexpectedly in one of our CLI integ tests #19618. I'm not sure what investigation, if any, has continued here.

We would probably take another look at this sooner than later if someone helps us by submitting a PR for this

Ok, in the meantime I'm using the Sed workaround and this review changeset feature is a must have for us.

I also opened a support ticket with enterprise support.

Thanks,
Regards

@gagipro
Copy link

gagipro commented May 2, 2023

still no action here? Unfortunately my workaround doesn't work anymore:

sed -i "s/ChangeSetName: changeSetName,/ChangeSetName: changeSetName,IncludeNestedStacks: true,/g" node_modules/aws-cdk/lib/api/deploy-stack.js
sed -i "s/ChangeSetName: changeSetName,/ChangeSetName: changeSetName,IncludeNestedStacks: true,/g" node_modules/aws-cdk/lib/index.js

doing that did the trick for me. But it looks like something has changed in the recent versions. I am on 2.70.0 now and I don't get the netested changes anymore.

Will investigate that later. It sucks not knowing what might change in a nested stack exactly.

    "sed -i 's/            ResourcesToImport: this.options.resourcesToImport,/            IncludeNestedStacks: true,\\n            ResourcesToImport: this.options.resourcesToImport,/g' /usr/local/lib/node_modules/aws-cdk/lib/api/deploy-stack.js",
    "sed -i 's/ResourcesToImport:this.options.resourcesToImport,/IncludeNestedStacks:true,ResourcesToImport:this.options.resourcesToImport,/g' /usr/local/lib/node_modules/aws-cdk/lib/index.js"

@gagipro
Copy link

gagipro commented May 2, 2023

I encounter this issue now that we intensively use CDK with Nested Stack. everytime there's no change in a stack it creates a failed changeset in the Nested that you cannot even delete.

aws/aws-cli#4534

Only way to remove them is to create a change that updates the Nested Stack...

we are close from the show stopper in production with all those defects.

Everyday I found a new issue

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 effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants