Question

Difficulty: MediumDeployment Strategies

A developer is configuring an AWS CodeDeploy Blue/Green deployment for a critical web application. The application runs on Amazon EC2 instances managed by an Auto Scaling group behind an Application Load Balancer. The deployment must satisfy the following constraints:

- If any issues are detected after shifting traffic to the new (Green) fleet, the application must be rolled back to the original (Blue) fleet within a 11-hour window.
- The rollback must be nearly instantaneous, avoiding the time required to provision new EC2 instances or initialize the application.
- To control costs, all resources from the original fleet must be automatically terminated after the 11-hour window if no issues are detected.

Which configuration settings in the CodeDeploy deployment group will meet these requirements?

  1. Configure the deployment group to redirect traffic immediately, set the action on the original instances to keep them running, and specify a rerun transition wait time of 11 hour before termination.Answer
  2. B
    Configure the deployment group to terminate the original Auto Scaling group immediately after traffic redirection, and set up an automatic rollback policy to launch a new Blue Auto Scaling group from the original launch template.
  3. C
    Configure the deployment group to perform an in-place deployment with a custom deployment configuration of CodeDeployDefault.OneAtATime, and set the rollback to trigger on CloudWatch alarms.
  4. D
    Configure the deployment group to use Route 53 weighted routing policy to shift traffic, and use an AWS Lambda function triggered by a CloudWatch alarm to delete the original Auto Scaling group after 11 hour.

Answer

Configure the deployment group to redirect traffic immediately, set the action on the original instances to keep them running, and specify a rerun transition wait time of 11 hour before termination.
The correct configuration is to configure the deployment group to redirect traffic immediately, keep the original instances running, and specify a wait time of 11 hour. In a CodeDeploy Blue/Green deployment, keeping the original (Blue) instances running inside the original Auto Scaling group allows CodeDeploy to perform a near-instantaneous rollback if an issue is detected. If the validation timer of 11 hour expires without any rollback being triggered, CodeDeploy automatically terminates the original instances and Auto Scaling group, ensuring that costs are controlled.

Step-by-Step Solution

1
Analyze the rollback requirement.
Since the rollback must be nearly instantaneous, the original (Blue) instances must remain running and active in their target group during the testing period.
If the instances are terminated, rolling back requires provisioning new EC2 instances, which takes several minutes and violates the time constraint.
2
Analyze the cost optimization requirement.
The original instances should not run indefinitely; they must be automatically terminated after the validation window.
This is achieved by specifying a wait time (e.g., 11 hour) in CodeDeploy's deployment configuration settings for original instances.
3
Select the correct CodeDeploy configuration option.
Configure CodeDeploy to redirect traffic immediately, keep the original fleet running, and set the wait time to 11 hour.
This satisfies all constraints by preserving the instances for fast rollback while ensuring automatic cleanup after 11 hour.

Key Concept

AWS CodeDeploy Blue/Green Deployment Instance Termination Lifecycle
Rate this question