(core): cross stack reference not properly generated in s3 scenario #25621
Labels
@aws-cdk/core
Related to core CDK functionality
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p1
Describe the bug
Discovered in #25605, when you try to create this particular cross-stack reference, the CDK only properly generates it when a stage is the parent between the two stacks. When a stage is not the parent between the two stacks, CDK generates a template with a standard reference to a resource that exists in another template.
Expected Behavior
I expect CDK to throw, because a cyclical reference is being made.
Current Behavior
An error is not thrown because the cross-stack reference isn't properly produced. Snippet from template:
Reproduction Steps
You can play around with how exactly the app is structured easily with the following snippet. The snippet here should throw, but readjusting the scope in which the inventory and bucket stacks are created will create invalid templates
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
latest
Framework Version
No response
Node.js Version
16
OS
mac
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: