-
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
(core): improve decoupling dependent stacks (currently can cause deploy failure) #19032
Comments
Hey @mikaelstaldal, Thank you for reporting this issue. It is however hard to determine what the cause of this behavior is from just the information provided. Could you please clarify with all the steps that resulted in this result as well as indicate why there is a problem arising if "Stack B" is deployed before "Stack A". While the Cloudformation and the CDK can intelligently detect most of these dependencies, there are cases where you must explicitly set it: stackB.node.addDependency(stackA); Additionally, if you are simply trying to update the stacks from when they had a dependency to not, you may run into trouble that can be resolved by deleting the existing stacks in dependent order, and then redeploying from scratch. Please let me know if this resolves your problem. |
OK, maybe it is working as documented. Then this is not a bug, but consider it a feature request, since I believe that it is unreasonably complicated to remove a dependency between stacks. |
That is a fair point. I actually think this is a higher-priority if a request for simplification, so I am converting the issue to a feature-request and bumping its priority for now. |
This will be resolved by weak references: aws/aws-cdk-rfcs#449 |
This is a very well known and documented issue, I don't think we need to track it here anymore |
|
Nevermind, this is a feature request to improve the experience. Reopening |
What is the problem?
I have a dependency between two stacks (stack A imports X which stack B exports). When I try to remove this dependency (stack A no longer imports X), it break if CDK decides to deploy stack B before stack A.
Reproduction Steps
N/A
What did you expect to happen?
CDK is clever enough to deploy stack A before stack B, and thus removing the import before removing the export.
What actually happened?
CDK deployed stack B before stack A, and deployment failed:
CDK CLI Version
2.12.0 (build c9786db)
Framework Version
No response
Node.js Version
v16.13.0
OS
Linux
Language
Java
Language Version
11
Other information
A workaround is to force a specific deployment order by adding an explicit dependency:
The text was updated successfully, but these errors were encountered: