0

I am new to aws services. We are having some ExpressJS Lambda projects created from CodeStar and are using default pipeline

(CodeCommit(source)-> CodeBuild(build&test)-> CloudFormation->(deployment)).

When we created project it deployed on Staging and Production. Now whenever we commit it does so. Now our problem is we need dev, qa, and production environment. At the moment we can manage with staging & prod. But I need a approval stage from staging to prod. But it auto deploys on both. I have searched a lot and visited many websites. But they only have diagrams showing CodeDeploy being used for deployment and in my case CodeFormation is being used. Didn't find some guide to integrate CodeDeploy.

I need help to maintain it from codecommit to stage to approval to prod.

Thanks

programmer
  • 61
  • 1
  • 4

1 Answers1

1

You could set it up like this:

CodeCommit(Source) -> CodeBuild(Build & Test) -> Cloudformation(Deployment to staging) -> Approval -> Cloudformation(Deployment to production)

That is exactly how i have it setup for a number of projects, although that is using Elastic Beanstalk for deployment. This pretty much ensures nothing can go directly to production without having been on staging first.

That would just require that you have a separate Cloudformation for staging and production deployment.

The approval step is one of the ones selectable in CodePipeline. You might want to set it up with an SNS topic, to get notifications when approval is needed.

colde
  • 3,192
  • 1
  • 15
  • 26
  • thanks for the answer. But the issue is in cloudformation there is stack template being used for deployment. Do you mean i need to edit that template and delete link to production and then add a approval at codepipeline and then add a new template at codeformation which design is only production env. – programmer Mar 14 '18 at 01:05
  • . or i need to edit same template and dont need to add new stack at cloudformation. In both cases can you show me example ? – programmer Mar 14 '18 at 01:19
  • @VailaInnoxent I would imagine you have to different stacks for staging and production? If those are combined you would need to split them into two. – colde Mar 15 '18 at 13:14
  • This is where i have issue. We created projects with codestar and it auto created pipeline for projects. Now in stack it deploys on both stages but when i try to edit stack. I delete production from stack. Later i need a new stack from staging to production but i am unable to create that stack. – programmer Mar 16 '18 at 05:40
  • You might need to redo it manually. Codestar has some not very great defaults unfortunately. – colde Mar 29 '18 at 23:28