Fredrik Meyer
Fredrik Meyer

Reputation: 143

Using aws-cdk pipelines with existing stacks

I'm trying to use the pipelines module to create a pipeline that updates stacks using CDK.

https://docs.aws.amazon.com/cdk/api/latest/docs/pipelines-readme.html

However, in all the docs, it seems like you have to create the stacks for each stage inside the pipeline stack. I have some existing stacks I would like to include in the pipeline, but I don't see how to do it.

It seems somewhat strange ownership-wise that the pipeline stack has the dev/prod stacks as children.

So the question is if there is a way to update existing stacks with the pipelines module?

Upvotes: 0

Views: 756

Answers (1)

fileyfood500
fileyfood500

Reputation: 1321

You can :) ! When you're making a pipeline, you can add stages to the pipeline with the .addStage() method.

The addStage method takes a list of actions, and the action for updating an existing stack is called CloudFormationCreateUpdateStackAction. You can use this action to specify updates for existing stacks.

Upvotes: 0

Related Questions