SAP-C02 Continuous Improvement for Existing Solutions Practice Question
A company uses AWS CodePipeline to deploy a web application. They want to automatically roll back the deployment if the new version fails CloudWatch alarm-based health checks. Which feature should they use?
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
✓
CodeDeploy automatic rollback configuration with CloudWatch alarm.
AWS CodeDeploy natively supports automatic rollback triggered by CloudWatch alarms. When a deployment causes a CloudWatch alarm to enter an ALARM state, CodeDeploy can automatically revert to the previous working version. This is the most straightforward and integrated solution for the requirement. Option A (Lambda + CloudWatch Events) is possible but not the primary recommended feature. Option B (Route 53 health checks) is for DNS-level failover, not deployment rollback. Option C (CodeBuild post-build actions) is for build phase, not post-deployment monitoring.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
AWS Lambda function invoked by CloudWatch Events.
Why it's wrong here
Lambda reacting to CloudWatch Events can trigger custom logic, but CodePipeline's native rollback on alarm failure is handled by CloudWatch alarm actions on the stage, not a separate Lambda. Lambda suits bespoke remediation workflows, not built-in deployment rollback.
- ✗
Amazon Route 53 health checks with failover routing.
Why it's wrong here
Route 53 failover shifts traffic to a healthy endpoint, but the deployment itself remains live and unrolled-back; it addresses availability, not pipeline rollback. Failover routing is correct for multi-region resilience, not for reverting a failed CodePipeline stage.
- ✗
AWS CodeBuild with post-build actions.
Why it's wrong here
AWS CodeBuild executes build and test commands; it has no mechanism to monitor CloudWatch alarms or trigger pipeline rollbacks. Its post-build actions run shell commands after the buildspec completes, not deployment health evaluation. CodeBuild would be the right choice for compiling code, running unit tests, or producing artefacts within a pipeline stage.
- ✓
CodeDeploy automatic rollback configuration with CloudWatch alarm.
Why this is correct
CodeDeploy automatic rollback redeploys the last known-good revision when a specified CloudWatch alarm enters ALARM state during deployment. This directly satisfies the requirement to roll back automatically on failed alarm-based health checks, without manual intervention or custom pipeline logic.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.