Courseiva

SAP-C02 Continuous Improvement for Existing Solutions Practice Question

A company runs a critical web application on EC2 instances behind an Application Load Balancer (ALB). During a recent deployment, users experienced errors. The team wants to automatically roll back the deployment if the error rate exceeds 5% within 10 minutes after deployment. Which solution meets these requirements with minimal operational overhead?

⚠ Common exam trap

SAP-C02 often tests whether candidates choose custom Lambda or manual gates for rollback automation, when the native CodeDeploy-CloudWatch alarm integration is the lowest-overhead, fully automated solution.

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 CodeDeploy with a CloudWatch alarm on the ALB error rate that triggers a deployment rollback.

AWS CodeDeploy integrates natively with CloudWatch alarms to automatically roll back a deployment when the alarm enters the ALARM state. By creating a CloudWatch alarm on the ALB's HTTP 5xx error rate (or target group error metric) with a threshold of 5% over a 10-minute period, and associating it with the CodeDeploy deployment group, CodeDeploy will trigger an automatic rollback if the alarm fires. This requires minimal operational overhead because it uses built-in integration.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Configure the Auto Scaling group to use ELB health checks and replace instances if the error rate increases.

    Why it's wrong here

    ELB health checks replace instances only when health checks fail, not when application error rates breach a threshold, so no rollback occurs. It is tempting because Auto Scaling does provide instance replacement, but the requirement needs CodeDeploy deployment rollback triggers based on CloudWatch alarms measuring error rate.

  • ✗

    Use CodeDeploy with manual approval gates and a script that checks error rates.

    Why it's wrong here

    Manual approval gates require a human to review and approve each rollback, so the 5%-in-10-minutes automatic trigger cannot fire without intervention. CodeDeploy alarms are the automated mechanism; approval gates suit change-control workflows needing sign-off before promotion, not time-critical auto-rollback.

  • ✓

    Use CodeDeploy with a CloudWatch alarm on the ALB error rate that triggers a deployment rollback.

    Why this is correct

    CodeDeploy integrates CloudWatch alarms directly into deployment monitoring, automatically rolling back to the previous revision when the alarm breaches its threshold. This meets the 5% error-rate and 10-minute window with minimal operational overhead, requiring no custom automation.

  • ✗

    Use a custom Lambda function that monitors ALB error rates and triggers a rollback via CodeDeploy API.

    Why it's wrong here

    Developing custom Lambda logic introduces significant operational overhead because it requires manual integration between CloudWatch metrics and CodeDeploy APIs. This approach is intended for bespoke monitoring requirements that standard deployment hooks cannot handle, such as checking external third-party API health. However, AWS CodeDeploy natively supports CloudWatch Alarm triggers to automate rollbacks during deployments, satisfying the requirement for minimal management without writing custom code.

About these practice questions

This SAP-C02 question is part of Courseiva's 984-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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.