Blue/Green Deployments with Elastic Beanstalk

Lab Details

  1. This lab walks you through the steps to setup Blue/Green deployments with AWS Elastic Beanstalk

  2. You will practice it using AWS Elastic Beanstalk

  3. Duration: 1 hour

  4. AWS Region: US East (N. Virginia) us-east-1

Introduction

AWS Elastic Beanstalk

  1. AWS Elastic Beanstalk is a Platform as a Service(PaaS) offered by Amazon for deploying and scaling web applications

  2. It allows us to use a wide selection of application platforms.

  3. It also enables us to have a variety of application deployment options. 

  4. It enables the developer to concentrate on developing rather than spending time on managing and configuring servers.

  5. It gives us the ability to automatically scale an application up and down based on the application’s specific needs. 

Blue/Green deployments with Elastic Beanstalk

  1. AWS Elastic Beanstalk performs normal deployments in the current production environment. Due to this, the application will be unavailable to users until the update is complete.

  2. This downtime can be avoided by performing a blue/green deployment.

  3. Blue/Green deployments are used to update an application from one version to another version without any downtime.

  4. The blue environment is your existing production environment carrying live traffic.

  5. The Green environment is an identical parallel new environment running a different or updated version of the application.

  6. Deploying of Blue/Green environments such that you can deploy a new version to a separate environment.

  7. Once the deployment is done, we simply route the traffic from the Blue environment to Green environment by swapping their CNAMEs or using Route 53 to slowly shift percentages of traffic over (not included in this lab)

  8. After the routing is complete, if you face any issues in the green environment, Elastic BeanStalk gives us an option to easily roll back to the blue environment.

Advantages

  • Zero downtime while updating the environments and swapping.

  • It’s Easy to roll back to the older version if you face any issues in the new environment.

Architecture Diagram

Tasks Details

  1. Launching Lab Environment

  2. Create an Elastic BeanStalk application.

  3. Create Elastic Beanstalk Blue Environment

  4. Create Elastic Beanstalk Green Environment

  5. Swap the URLs from Blue to Green

  6. Validation of the lab.