A company uses AWS CodeDeploy and needs the deployment to meet these requirements: a subset of instances must remain serving traffic, traffic is balanced across those instances and they auto-heal; launch a new fleet automatically for the new revision with no manual provisioning; shift traffic to the new fleet in half-instance increments and require success only if at least half the instances receive traffic; remove temporary deployment files before routing traffic to the new fleet; after successful deployment, immediately terminate the original instances to reduce cost. How can this be implemented?
Choose an answer
Tap an option to check your answer.
Correct answer: Use an Application Load Balancer with a blue/green deployment. Associate the Auto Scaling group and ALB target group with the deployment group, enable Automatically copy Auto Scaling group, use CodeDeployDefault.HalfAtATime as the deployment configuration, instruct CodeDeploy to terminate the original instances, and use the BeforeAllowTraffic hook in appspec.yml to delete temporary files..
Why this is the answer
The correct option uses a blue/green deployment with an Application Load Balancer (ALB), which is essential for launching a new fleet automatically and shifting traffic incrementally. Associating the Auto Scaling group and ALB target group with the deployment group and enabling "Automatically copy Auto Scaling group" ensures the new fleet is provisioned correctly. The CodeDeployDefault.HalfAtATime deployment configuration meets the requirement to shift traffic in half-instance increments and succeed if at least half receive traffic. Instructing CodeDeploy to terminate original instances fulfills the cost-reduction requirement. The BeforeAllowTraffic hook in appspec.yml allows for deleting temporary files before traffic is routed to the new fleet. Incorrect options: In-place deployments modify existing instances, which doesn't meet the requirement to launch a new fleet automatically. CodeDeployDefault.OneAtATime or AllAtOnce do not match the "half-instance increments" requirement. BeforeBlockTraffic or BlockTraffic hooks are not suitable for deleting temporary files before routing traffic to the new fleet.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed