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:
- Can deploy the app manually via
sam deploy
for testing, while using the pipeline for prod. - Can clone the app to multiple regions or accounts with pipeline stages
- 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.)