-
Notifications
You must be signed in to change notification settings - Fork 4.5k
pipelines: Runtime error when a Stage has multiple Stacks with the same stack name #30960
Description
Describe the bug
This is a duplicate of issue #30449 which should not have been closed.
To provide additional context, if you have an app that you are deploying without pipelines, this behavior works, because the logical ids are different. Using waves only solves the case where you have two stacks with no other dependencies, or dependencies that are in the same region. If you have stacks which consume variables or exports from other stacks cross region by passing crossRegionReferences: true it is not possible to split these stacks into separate stages, because it is not possible to consume variables from stage to stage. This causes working cdk apps to be unable to be adopted by cdk pipelines.
Expected Behavior
App is able to synth and deploy
Current Behavior
Stacks with the same name but different IDs in the same stage cause a runtime error:
Reproduction Steps
See duplicate issue
Possible Solution
Add an explicit override parameter that can be used to bypass this check (which I'm sure does save a lot of headaches if code gets mistakenly copy pasted)
Additional Information/Context
No response
CDK CLI Version
2.150.0 (build 3f93027)
Framework Version
No response
Node.js Version
v18.20.4
OS
Mac
Language
TypeScript
Language Version
No response
Other information
No response