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

[aws-eks] Nested stacks always cause an update #6046

Closed
moatazelmasry2 opened this issue Jan 31, 2020 · 3 comments · Fixed by #6346
Closed

[aws-eks] Nested stacks always cause an update #6046

moatazelmasry2 opened this issue Jan 31, 2020 · 3 comments · Fixed by #6346
Assignees
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service guidance Question that needs advice or information.

Comments

@moatazelmasry2
Copy link
Contributor

❓ General Issue

The Question

This is not a bug report per se. So I'm creating an EKS cluster using the cdk. Things work well and it creates a couple of nested stacks.
Now when I run cdk deploy without changing a line, it will re update all those nested stacks and the main stack as well.

Is this the expected behavior. What is actually being changed everytime??

@moatazelmasry2 moatazelmasry2 added the needs-triage This issue or PR still needs to be triaged. label Jan 31, 2020
@SomayaB SomayaB added guidance Question that needs advice or information. @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service labels Feb 4, 2020
@SomayaB
Copy link
Contributor

SomayaB commented Feb 4, 2020

Hi @moatazelmasry2, the default behavior for cdk deploy is to update ALL stacks. If you only want to deploy one, then you would need to specify the stack name after “deploy” (ie. cdk deploy NotNestedStack). Hope that helps! If you have other questions a great place to start is to look on Stackoverflow or on Gitter. Thanks!

@SomayaB SomayaB added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Feb 4, 2020
@SomayaB SomayaB self-assigned this Feb 4, 2020
@SomayaB SomayaB added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. closing-soon This issue will automatically close in 4 days unless further comments are made. labels Feb 4, 2020
@moatazelmasry2
Copy link
Contributor Author

moatazelmasry2 commented Feb 5, 2020 via email

@SomayaB SomayaB removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Feb 10, 2020
@SomayaB SomayaB assigned eladb and unassigned SomayaB Feb 10, 2020
@eladb
Copy link
Contributor

eladb commented Feb 11, 2020

Unfortunately there isn’t much we can do at the CDK level to address this. CloudFormation will always attempt to update nested stacks, even if they did not change. We have reached out to the CloudFormation team and proposed a way to avoid it. We will follow up on this issue when we have more information.

@eladb eladb changed the title EKS Stack updates on every execution Nested stacks always cause an update Feb 11, 2020
@SomayaB SomayaB added the needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. label Feb 14, 2020
eladb pushed a commit that referenced this issue Feb 18, 2020
Bail-out before executing and creating change sets when the currently deployed template is identical to the one we are about to deploy.

This resolves #6046, where a stack that contains nested stack(s) will always try to update since CloudFormation assumes the nested template might have changed. In the CDK, since nested template URLs are immutable, we can trust that the URL will be changed, and therefore invalidate the *parent* template.

This also fixes the bug described in #2553, where a stack that includes a `Transform` always fail to deploy with `No updates are to be performed` when there are no changes to it.

The switch `--force` can be used to override this behavior.

Added unit test and performed a few manual tests to verify both bugs are resolved.

Resolves #6216
@mergify mergify bot closed this as completed in #6346 Feb 19, 2020
mergify bot added a commit that referenced this issue Feb 19, 2020
* feat(cli): skip deployment if template did not change

Bail-out before executing and creating change sets when the currently deployed template is identical to the one we are about to deploy.

This resolves #6046, where a stack that contains nested stack(s) will always try to update since CloudFormation assumes the nested template might have changed. In the CDK, since nested template URLs are immutable, we can trust that the URL will be changed, and therefore invalidate the *parent* template.

This also fixes the bug described in #2553, where a stack that includes a `Transform` always fail to deploy with `No updates are to be performed` when there are no changes to it.

The switch `--force` can be used to override this behavior.

Added unit test and performed a few manual tests to verify both bugs are resolved.

Resolves #6216

* Add alias -f for —force

* Add integration test

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@iliapolo iliapolo changed the title Nested stacks always cause an update [aws-eks] Nested stacks always cause an update Aug 16, 2020
@iliapolo iliapolo removed the needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. label Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service guidance Question that needs advice or information.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants