pipelines: Stage can't deploy an existing stack bound to another scope #26074
Labels
@aws-cdk/pipelines
CDK Pipelines library
bug
This issue is a bug.
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
I have an existing application, with a stack called 'ExampleStack' that I have been deploying via
cdk deploy ExampleStack
. It's bound to the scope of the app:I want to set up a new code pipeline, using CDK Pipeline to deploy ExampleStack, per AWS recommended best practices.
However, when I move the example stack into a stage:
...the logical id of the stack changes, since it's now in the scope of the Stage, not the app, meaning an entirely new stack with duplicated resources is created which is not the desired behavior.
If I use the app in the stage:
...it fails during synthesis time with:
Expected Behavior
A convenient and documented way of deploying existing stacks in stages without having to recreate the or import their resources into a new stack.
Current Behavior
Stacks are recreated when moved into stages, or blueprint errors are thrown.
Reproduction Steps
See above.
Possible Solution
Update the stage synth method to allow a scope to be passed in, and reference it during synthesis:
...and updating what invokes snyth to pass on the new argument as well.
Additional Information/Context
No response
CDK CLI Version
2.83.0 (build 0fd7f2b)
Framework Version
No response
Node.js Version
18
OS
mac
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: