Open aagarwallazs opened 3 months ago
Sounds like you are having multiple consumer stacks sharing a single producer stack?
As crossStackReference only supports strong reference, it would be a challenge with multiple consumer stacks sharing a single producer stack unless we support weak references. See Constraints in the doc for more details.
Making this a p2 FR and we welcome upvotes 👍 to help us prioritize.
Describe the bug
When trying deploy the same child stack in multiple regions where one of the region is same as the parent stack, that refers to one parent stack, the deployment of subsequent child stack fails while trying to update the exports of the parent stack.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
When trying to deploy the same child stack in multiple regions (where one region is same as the parent's stack region), referring to one parent stack, the exports between the other stacks should not be deleted.
Current Behavior
AWS CDK is trying to delete the exports between two different stacks, which might be referring to one common stack output.
Example Infra : Deploy the dynamodb DB stack in us-east-1, which is the parent stack. This DB table details need to be passed to the child lambda stacks.
Let's take the following scenarios for the above example :
From the above, it looks like cdk is first trying to delete the local export for the same region (us-east-1) and then trying to create a cross regional export. But since there is lambda referring to the local export, it fails to delete the export.
From the above, it looks like cdk is first trying to delete the cross regional export (SSM parameter) for the eu-central-1 and then trying to create a local export. But since there is lambda referring to the cross regional export, it fails to delete the export.
Reproduction Steps
Repro the issue in 2 ways
Following code for the above example infra.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.140.0 (build 46168aa)
Framework Version
No response
Node.js Version
v20.13.0
OS
Windows Subsystem on Linux (Ubuntu 22.04)
Language
Python
Language Version
3.10.12
Other information
No response