Can you please help with some guidelines for codepipeline?


Hello can somebody please give me some guidelines to building our pipeline with an autoscaling group.

From my understanding we should build a base ami and then when autoscaling needs another instance the base is launched and codedeploy is called and the application updated with the latest version. Because of our application we are needing our ami to be setup with the latest versions of our application and not have it build on the fly at launch.

This is our thinking of how it would work.

  1. Push our code to bitbucket and have it trigger the pipeline to launch an instance from our latest ami.
  2. Setup the application code on the ec2 instance.
  3. Create a new ami and update our launch template version with the new ami.
  4. Swap out the current versions of EC2s to the new version.

So for this scenerio, would it be best to use codebuild to build out the ec2 and setup the application. Then use codedeploy for a Blue/Green deployment or would it be best to do it all in the codedeploy? Any suggestions are welcome

Thank you

asked 16 days ago83 views
1 Answer


I think, if we tie up the solutions mentioned here i.e. Create AMIs with AWS CodePipeline with Introducing Instance Refresh for EC2 Auto Scaling , you should get what you are looking for.

Alternatively, I suggest you consider Elastic Beanstalk, it could help bring everything down to just bringing your code. Refer Blue/Green deployments with Elastic Beanstalk

Hope this helps!

Thanks, Rama

profile pictureAWS
answered 15 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions