Course menuDOP-C02

Exams / DOP-C02 / Deployments for ECS and EKS / Question 1

DOP-C02 practice question: Deployments for ECS and EKS (1 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 video streaming service runs its recommendations API as an Amazon ECS service on AWS Fargate, behind an Application Load Balancer. The team deploys the service with the default rolling update.

Last month a faulty image passed its health checks in the first minutes and then failed under load, and the rolling update had replaced most tasks before the alarms fired. The team wants a new version to receive live traffic first from a small share of users, to be shifted fully only if the alarms stay quiet for 10 minutes.

Any alarm on the 5xx error rate must return traffic to the previous version immediately, without a manual step.

Which deployment approach meets these requirements?

Choose one answer.

  1. A. Keep the rolling update and turn on the deployment circuit breaker with rollback, so that a deployment rolls back when tasks repeatedly fail to become healthy during the update.
  2. B. Switch the ECS service to the EXTERNAL deployment controller and shift listener weights with a script that adds 10 percent every minute, while an engineer watches the dashboard.
  3. C. Create a second ECS service with the new version, point a Route 53 weighted record at each service, and delete the old service once the change is complete.
  4. D. Use a CodeDeploy blue/green deployment for ECS with a canary traffic shift, and a CloudWatch alarm on 5xx errors that triggers automatic rollback.
Show the answer and explanation

Answer: D

Explanation

CodeDeploy blue/green deployments for Amazon ECS run a replacement task set, shift listener traffic in stages and roll back when CloudWatch alarms fire. A canary configuration sends a small share first and the rest after a wait, which matches the requirement. The rolling update's circuit breaker reacts to failed tasks, and DNS weights and manual shifting cannot roll back quickly.

A canary deployment with alarm-based rollback Users reach the service through a traffic-shifting layer such as a Lambda alias, load balancer or endpoint. Most traffic goes to the current version and a small share goes to the new version. A CloudWatch alarm on the new version's errors rolls traffic back to the current version. Users Traffic shifting alias, ALB or endpoint Current version most traffic New version small share first CloudWatch alarm errors, latency roll back
CodeDeploy starts a replacement task set, shifts a canary share of traffic to it, and rolls back on the 5xx alarm.

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 Deployments for ECS and EKS? The 5 full-length practice sets have 8 more Deployments for ECS and EKS questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets