DVA-C02 CodeDeploy Rollback Practice Question
A company uses AWS CodeDeploy to deploy a web application to an Auto Scaling group. The deployment fails, and the rollback is triggered. However, the rollback also fails. What is a likely cause?
⚠ Common exam trap
A common trap is assuming rollback always succeeds if the original deployment did. Rollback can fail if the previous version's AppSpec file references resources (e.g., lifecycle hooks) that have been removed or changed.
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
✓
The rollback deployment uses an AppSpec file that references a lifecycle hook that does not exist in the current environment.
The correct option is A: the rollback deployment uses an AppSpec file that references a lifecycle hook that does not exist in the current environment. During a CodeDeploy rollback, CodeDeploy redeploys the last known good revision, and if that revision's AppSpec file defines a lifecycle event hook (for example, a Lambda validation hook or a script in the wrong location) that is not present or valid in the current environment, the rollback deployment will fail just as the original did. Options B, C, and D are less likely because a misconfigured load balancer target group, a missing S3 artifact bucket, or insufficient Auto Scaling capacity would typically cause the initial deployment to fail rather than specifically explaining why the rollback itself fails due to the prior revision's configuration.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The rollback deployment uses an AppSpec file that references a lifecycle hook that does not exist in the current environment.
Why this is correct
A CodeDeploy rollback re-deploys a previously successful application revision, utilizing that revision's specific AppSpec file. If this AppSpec file contains a 'hooks' section referencing a script, an IAM role, or a lifecycle event that has since been removed or become invalid in the target environment, the rollback deployment will fail when attempting to execute that non-existent or misconfigured hook. This scenario highlights how environmental drift can cause a previously successful revision's deployment instructions to become unexecutable.
- ✗
The target group for the load balancer is not properly configured.
Why it's wrong here
A misconfigured target group, such as incorrect port mappings or health check paths, would primarily cause instances to fail health checks during a deployment or rollback. While this would prevent instances from being registered as healthy and could ultimately lead to a deployment failure, it would not inherently prevent the CodeDeploy service from initiating or attempting the rollback process itself. The rollback would proceed, but the instances might never reach a healthy state, causing the deployment to stall or fail due to health check issues, not a fundamental rollback process failure.
- ✗
The Amazon S3 bucket containing the deployment artifacts is missing.
Why it's wrong here
If the Amazon S3 bucket containing the application revision artifacts were missing, the *initial* deployment would fail immediately because CodeDeploy would be unable to retrieve the necessary files to begin the deployment process. A rollback operation, however, attempts to deploy a *previously successful* revision. The artifacts for that previous revision would have already been successfully retrieved and processed during its initial deployment, making a missing S3 bucket an unlikely direct cause for a rollback failure unless the original artifacts were also subsequently deleted.
- ✗
The Auto Scaling group does not have sufficient capacity to run the rollback.
Why it's wrong here
Insufficient capacity within an Auto Scaling group would indeed prevent any deployment, including a rollback, from successfully adding new instances or replacing existing ones. However, a rollback operation typically uses the *same* underlying Auto Scaling group and its configured capacity. If the Auto Scaling group already has instances running, a rollback would attempt to deploy to those or replace them. A lack of *sufficient capacity* would affect the ability to scale out or replace instances during *any* deployment, not specifically cause a rollback to fail due to its nature as a rollback.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
This DVA-C02 question is part of Courseiva's 1,135-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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-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 DVA-C02 exam.