Your application is currently running on Amazon EC2 instances behind a load balancer.
Your management has decided to use a Blue/Green deployment strategy.
How should you implement this for each deployment?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer - C.
The below diagram shows how this can be done.
1) First, create a new ELB which will be used to point to the new production changes.
2) Use the Weighted Route policy for Route53 to distribute the traffic to the 2 ELB's based on a 80-20% traffic scenario.
This is the normal case; the % can be changed based on the requirement.
3) Finally, when all changes have been tested, Route53 can be set to 100% for the new ELB.Option A is incorrect because this is a failover scenario and cannot be used for Blue-green deployments.
In Blue-Green deployments, you need to have 2 environments running side by side.
Option B is incorrect, because you need to have a production stack with the changes which will run side by side.
Option D is incorrect because this is not a blue-green deployment scenario.
You cannot control which users will go to the new EC2 instances.
For more information on blue-green deployments, please refer to the below document link: from AWS.
https://d0.awsstatic.com/whitepapers/AWS_Blue_Green_Deployments.pdfBlue/Green deployment is a deployment strategy that helps in achieving zero-downtime while deploying new changes to the application. In this approach, two identical environments, blue and green, are set up. The current production environment is running in the blue environment, while the new changes are deployed to the green environment. Once the new environment is tested and validated, the traffic is switched from blue to green environment in a controlled manner.
In this scenario, the application is currently running on Amazon EC2 instances behind a load balancer, and the management has decided to use a Blue/Green deployment strategy. To implement Blue/Green deployment, we need to create a new environment (Green) with updated code and configuration and then switch traffic from the old environment (Blue) to the new environment (Green) once it is tested and validated.
Let's evaluate the provided answer options for implementing Blue/Green deployment:
Option A: Set up Amazon Route 53 health checks to failover from any Amazon EC2 instance currently being deployed.
This option is incorrect because Amazon Route 53 health checks are used for checking the health of instances and routing the traffic to the healthy instances. However, in a Blue/Green deployment, we are creating a new environment, and we want to route traffic from the old environment to the new environment once it is tested and validated.
Option B: Using AWS CloudFormation, create a test stack for validating the code and then deploy it to each production Amazon EC2 instance.
This option is also incorrect because using AWS CloudFormation, we can automate the infrastructure deployment process, but it doesn't provide an isolated environment for testing the changes before deploying them to the production environment.
Option C: Create a new load balancer with new Amazon EC2 instances, carry out the deployment, and then switch DNS over to the new load balancer using Amazon Route 53 after testing.
This option is correct. Here, we create a new environment (Green) with new Amazon EC2 instances and a new load balancer. We deploy the changes to the new environment and test it thoroughly. Once the new environment is validated, we switch the DNS routing from the old load balancer to the new load balancer using Amazon Route 53. This way, the traffic starts to flow to the new environment, and the old environment is decommissioned.
Option D: Launch more Amazon EC2 instances to ensure high availability, de-register each Amazon EC2 instance from the load balancer, upgrade it, test it, and then register it again with the load balancer.
This option is incorrect because it doesn't provide an isolated environment for testing the changes before deploying them to the production environment. Also, in a Blue/Green deployment, we create a new environment and decommission the old environment once the new environment is tested and validated. Here, we are upgrading the same environment without creating a new environment, which is not a Blue/Green deployment strategy.
Therefore, the correct answer is option C, i.e., create a new load balancer with new Amazon EC2 instances, carry out the deployment, and then switch DNS over to the new load balancer using Amazon Route 53 after testing.