-
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): unused cross-region exports can't be deleted #27902
Comments
Hi @shahin , could you please share the sample code so that this issue can be reproduced |
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. |
Thanks for your attention to this issue. The reproduction steps above are the best I can do for now. |
I am facing this issue as well. @shahin do you know if there is a workaround? Is manually deleting the SSM parameters in all regions before deploy a way to get around this? Im debugging in a dev environment now but trying to figure out how I'm going to roll my changes out to prod without a crash; makes me nervous haha
My scenario was slightly different, but essentially the same issue.
|
@renschler sorry, I don't know of a workaround in CDK. Deleting the SSM parameters might be part of the solution but did not by itself unblock deployment for us.
If stack B depends on stack A, you can still deploy stack B by itself with the
|
ps as a warning to others, don't delete those unnecessary SSM paramters, it will create more issues! I'm now having to re-add them manually to SSM in every region where I deleted them. then after manually re-adding you'll hit a "last modified date does not match with the last modified date of the retrieved parameters" error during deploy, the only way to fix was to run cdk synth and then manually update the stacks in the aws console using the generated json template in cdk.out/ |
Given the bug found by @elliotsegler in #29699, it looks like the error Perhaps a workaround is removing that tag and then redeploying? I understand the tag is there to stop updates 2, but I'm not sure why that's necessary 3. (So this workaround might not be a very good workaround!) In my case I am making a change that removes a cross-region reference so... should be fine? Footnotes
|
@NickDarvey I'm wondering if that's an ordering issue... The cross-region-reader-handler and associated In my issues I was letting CDK resolve the order of operations, and it was attempting to delete resources in the stack that contained the exports before updating the reader stack which would have removed those tags. I worked around it by specifically calling a deployment of the reader stack, then a second phase of deployments to the stack that contained now unused exports. Footnotes |
That would have worked for me too actually! |
@TheRealAmazonKendra I made a reproduction repo here; if anyone has issues reproducing let me know and I can help explain! |
Looks like we got hit by this too. The stack is now in Any workarounds to get it un stuck? Would skipping the resource be safe? |
I can see the challenge here: if I export a cross-region reference from stack A to stack B, and stack B depends on resources in stack A, and I delete the resource this cross-region reference refers to, I then have a cyclic update dependency. From the ADR linked above, I'd want to update stack B (export reader), then stack A (export writer). However, since stack B depends on resources in stack A, I'd want to update stack A, then stack B. As a result, neither stack is safe to update before the other. Maybe an ideal resolution would be to detect the cyclic dependency here and fast-fail? In cases like this, I'd much rather have fast-fail behaviour than unblock |
Any updates for this issue? |
This is giving us headaches as well. Any update would be immensely helpful. Thanks! |
On my side, got it fixed by:
|
I see two EASY solutions conceptually, but maybe harder technically. Then you can really easily create a new resource along the old if you need to replace something, like a Certificate, or remove the resource if that's what you need. |
Describe the bug
If a stack maintains multiple cross-region exports, and some subset of cross-region exports are being imported by other stacks, attempting to remove any cross-region export value that is not being used (imported) by any deployed stack:
Fails with the following error on
cdk deploy
:Other issues don't describe this bug:
Expected Behavior
CDK should fail to deploy with the error above only if the
cdk diff
shows an export being removed that is currently imported by another stack.Current Behavior
CDK fails to deploy with the error above even when
cdk diff
shows only exports being removed that are not currently imported by another stack.Reproduction Steps
["CrossRegionExportReader"]["ReaderProps"]
template in the CloudFormation console.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.94.0 (build 987c329)
Framework Version
No response
Node.js Version
v18.17.1
OS
macOS
Language
Python
Language Version
Python (3.10.4)
Other information
No response
The text was updated successfully, but these errors were encountered: