Course menuDOP-C02

Exams / DOP-C02 / CodeDeploy on EC2 and on-premises (agent, AppSpec, hooks) / Question 2

DOP-C02 practice question: CodeDeploy on EC2 and on-premises (agent, AppSpec, hooks) (2 of 2)

SDLC Automation A free question from our original DOP-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A regional bank runs its online banking web tier on Amazon EC2 instances in an Auto Scaling group behind an Application Load Balancer. Releases currently use CodeDeploy in-place deployments, and a failed release has left some instances serving the old and new code at once.

The release manager wants each release to build a complete replacement fleet, check it before any customer traffic reaches it, and keep the original fleet running for an hour so that a rollback is only a traffic change. After that hour, the original instances must be terminated without anyone doing it by hand.

The team wants to keep using CodeDeploy for the application package and lifecycle hooks.

Which approach meets these requirements?

Choose one answer.

  1. A. Change the deployment group to use an in-place deployment with the OneAtATime configuration and a longer ValidateService hook, so that each instance is checked before the next one is updated.
  2. B. Create a second Auto Scaling group by hand for each release, copy the application package onto its instances with a Run Command document, and point the load balancer at the new group after the health checks pass.
  3. C. Configure a CodeDeploy blue/green deployment for the group, with CodeDeploy provisioning a replacement fleet, shifting load balancer traffic after the checks pass, and terminating the old instances after a wait.
  4. D. Replace the CodeDeploy deployment with a rolling instance refresh of the Auto Scaling group, using a launch template that points at the new application package in Amazon S3.
Show the answer and explanation

Answer: C

Explanation

CodeDeploy blue/green deployments for EC2 Auto Scaling groups build a separate replacement fleet and move traffic to it only after the deployment succeeds. The original fleet stays available for a rollback window before it is terminated, which turns a rollback into a traffic change. In-place updates, hand-built fleets and instance refreshes each miss part of this.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on CodeDeploy on EC2 and on-premises (agent, AppSpec, hooks)? The 5 full-length practice sets have 9 more CodeDeploy on EC2 and on-premises (agent, AppSpec, hooks) questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets