Skip to content

blue/green deployments using CodeBuild, CodeDeploy and CodePipeline

Notifications You must be signed in to change notification settings

leonjalfon1/ec2-blue-green-deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blue/Green Deployment for Autoscaling Groups with CodePipeline, CodeBuild and CodeDeploy

In this tutorial:

In this tutorial we will create an initial environment composed by an autoscaling group with two ubuntu machines behind a load balancer, then we will create a CI/CD pipeline to provide blue/green deployments using CodeBuild, CodeDeploy and CodePipeline.

  1. Prerequisites
  2. Setup initial environment
  3. Configure CodeBuild
  4. Configure CodeDeploy
  5. Configure CodePipeline
  6. Putting all together

The benefits of blue/green deployments

Blue/green deployment involves two production environments:

  • Blue is the active environment.
  • Green is for the release of a new version.

Here are some of the advantages of a blue/green deployment:

  • You can perform testing on the green environment without disrupting the blue environment.
  • Switching to the green environment involves no downtime. It only requires the redirecting of user traffic.
  • Rolling back from the green environment to the blue environment in the event of a problem is easier because you can redirect traffic to the blue environment without having to rebuild it.
  • You can incorporate the principle of infrastructure immutability by provisioning fresh instances when you need to make changes. In this way, you avoid configuration drift.

AWS CodeDeploy offers two ways to perform blue/green deployments:

  • In the first approach, AWS CodeDeploy makes a copy of an Auto Scaling group. It, in turn, provisions new Amazon EC2 instances, deploys the application to these new instances, and then redirects traffic to the newly deployed code.
  • In the second approach, you use instance tags or an Auto Scaling group to select the instances that will be used for the green environment. AWS CodeDeploy then deploys the code to the tagged instances.

References

About

blue/green deployments using CodeBuild, CodeDeploy and CodePipeline

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •