AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 217

A company is using AWS CodeDeploy to automate software deployment. The deployment must meet these requirements:

• A number of instances must be available to serve traffic during the deployment. Traffic must be balanced across those instances, and the instances must automatically heal in the event of failure. • A new fleet of instances must be launched for deploying a new revision automatically, with no manual provisioning.
• Traffic must be rerouted to the new environment to half of the new instances at a time. The deployment should succeed if traffic is rerouted to at least half of the instances: otherwise, it should fail.
• Before routing traffic to the new fleet of instances, the temporary files generated during the deployment process must be deleted.
• At the end of a successful deployment, the original instances in the deployment group must be deleted immediately to reduce costs.

How can a DevOps engineer meet these requirements?

Answer options

Correct answer: C

Explanation

Option C is correct because it uses a blue/green deployment strategy with the Application Load Balancer, which meets the requirement for traffic rerouting to half of the new instances at a time. The BeforeAllowTraffic hook is also appropriate as it ensures temporary files are deleted before traffic is sent to the new instances. Options A and D use in-place deployments, which do not satisfy the requirement for launching a new fleet of instances, while B does not utilize the correct deployment configuration required for the 50% healthy hosts criterion.