core: CrossRegionReferences does not work when deploying child stack in multiple regions that include the region of the parent stack. #31105
Labels
@aws-cdk/core
Related to core CDK functionality
cross-stack
Related to cross-stack resource sharing
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
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
The text was updated successfully, but these errors were encountered: