Courseiva

SAP-C02 Continuous Improvement for Existing Solutions Practice Question

A company uses AWS CodePipeline to deploy a web application to Amazon ECS. The deployment often fails because the ECS service's desired count is not met during the update. The company wants to implement a blue/green deployment with automated rollback on failure. What is the MOST effective approach?

⚠ Common exam trap

The trap is thinking a custom Lambda or rolling update with alarms is equivalent to CodeDeploy blue/green — only CodeDeploy provides native automated rollback and traffic shifting for ECS.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Use CodePipeline with CodeDeploy to perform a blue/green deployment on ECS and configure automatic rollback.

CodePipeline integrated with CodeDeploy for ECS blue/green deployments provides automated traffic shifting, health monitoring, and automatic rollback on failure. CodeDeploy manages the replacement task set, shifts traffic via the load balancer, and rolls back if alarms fire or health checks fail, which directly addresses the desired count issue.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Use CodePipeline with a Lambda function to swap target groups and monitor health.

    Why it's wrong here

    A custom Lambda swapping target groups lacks CodeDeploy's ECS traffic-shifting and alarm-driven automatic rollback, so failed deployments are not reverted. It suits bespoke orchestration; the requirement for automated rollback on ECS points to CodeDeploy's blue/green deployment configuration.

  • ✗

    Use CodeDeploy with an in-place deployment configuration and a manual approval step.

    Why it's wrong here

    In-place deployment replaces tasks within the same service, so the desired count can still drop and no second environment exists for rollback. It fits simple single-environment updates; blue/green with CodeDeploy and load balancer target groups is needed for traffic shifting and automatic rollback.

  • ✗

    Use CodePipeline with ECS rolling update and CloudWatch alarms to trigger rollback.

    Why it's wrong here

    ECS rolling update keeps one service and shifts tasks gradually, so a failed desired count leaves no previous environment to revert to automatically. It suits low-risk incremental releases; the stem's blue/green with automated rollback requires CodeDeploy managing two target groups.

  • ✓

    Use CodePipeline with CodeDeploy to perform a blue/green deployment on ECS and configure automatic rollback.

    Why this is correct

    CodeDeploy's ECS blue/green deployment shifts production traffic between two target groups only after the replacement task set reaches steady state, so the desired-count constraint is verified before cutover. CloudWatch alarms trigger automatic rollback to the original task set, restoring the previous listener rule without manual intervention.

About these practice questions

One of 984 original SAP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint

This SAP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAP-C02 exam.