Question

Difficulty: MediumDeployment Strategy Design

An enterprise is designing a deployment pipeline for a legacy Java application hosted on Amazon EC2 instances within an Auto Scaling group behind an Application Load Balancer. The deployment must achieve zero downtime and allow for a 1-hour verification window where the old version remains active but receives no traffic, enabling rapid rollback if issues are detected. If the validation succeeds, the old instances must be automatically terminated. The deployment process must be fully managed with minimal custom configuration. Which two configurations should the Solutions Architect include in the AWS CodeDeploy deployment group to meet these requirements? (Select two.)

  1. Configure the deployment group to copy the Auto Scaling group and use the Application Load Balancer target group to route traffic.Answer
  2. Configure the deployment group settings to reroute traffic immediately, and set the original Auto Scaling group instances to terminate after a waiting period of 60 minutes.Answer
  3. C
    Set the deployment configuration to CodeDeployDefault.EC2Linear10PercentEvery10Minutes to shift traffic between the blue and green environments.
  4. D
    Configure an Auto Scaling lifecycle hook on the original Auto Scaling group for the EC2_INSTANCE_TERMINATING transition with a heartbeat timeout of 3600 seconds.
  5. E
    Create a second Auto Scaling group for the new version and configure an Amazon Route 53 weighted routing policy to shift traffic between the two Auto Scaling groups over 60 minutes.

Answer

Configure the deployment group to copy the Auto Scaling group and use the Application Load Balancer target group to route traffic, and configure the deployment group settings to reroute traffic immediately while setting the original Auto Scaling group instances to terminate after a waiting period of 60 minutes.
For an EC2 Auto Scaling deployment using CodeDeploy, a blue/green deployment requires copying the Auto Scaling group and using an Application Load Balancer target group to route traffic. Setting the deployment group to reroute traffic immediately and setting the original instances to terminate after a 60-minute wait time ensures that traffic shifts to the new version immediately while keeping the old instances running and deregistered from the load balancer. This provides a 1-hour window for verification and rapid rollback without downtime, followed by automated termination.

Step-by-Step Solution

1
Determine the deployment type and environment configuration.
CodeDeploy Blue/Green deployment is chosen, configuring the deployment group to copy the original Auto Scaling group and swap traffic via the Application Load Balancer target group.
This establishes a fully managed blue/green setup where CodeDeploy handles the creation of the green environment automatically.
2
Configure the traffic rerouting and validation window.
Set the deployment group to reroute traffic immediately once the green instances pass health checks, and configure the original instances' termination wait time to 60 minutes.
This meets the requirement of keeping the old instances active but not receiving traffic (deregistered) for a 1-hour verification period to allow rapid rollback.

Key Concept

AWS CodeDeploy Blue/Green deployment configurations for EC2 Auto Scaling Groups
Rate this question