Home > Software engineering >  How to work with codepipeline in SAM project?
How to work with codepipeline in SAM project?

Time:11-20

I have a SAM project to deploy my app, I deploy this stack using sam build and sam deploy

I recently added a codepipeline (with all its resources) to the template. The problem is that when I deployed the app, code pipeline created another stack.

Is there a way to mantain only 1 stack?

If not I must separate them as nested stack o different stacks?

CodePudding user response:

TLDR; Adding CodePipeline to a SAM app necessitates an additional CloudPipeline stack.

The Codepipeline stack is independent of the "app stacks". This loose coupling is helpful:

  1. Can deploy the app manually via sam deploy for testing, while using the pipeline for prod.
  2. Can clone the app to multiple regions or accounts with pipeline stages
  3. Can add fancy test or approval actions in the pipeline without touching the app code

(It also seems like this setup helps AWS avoid tricky chicken-and-egg dependency problems of having to bootstrap the pipeline before deploying on the app resources.)

  • Related