Courseiva
Incident and Event Response →mediumMultiple Choice

DOP-C02 Incident and Event Response Practice Question

A DevOps team uses AWS CodeDeploy to deploy an application to an Auto Scaling group. The deployment fails with an error 'The overall deployment failed because too many individual instances failed deployment'. The team checks the instance logs and finds that the 'BeforeInstall' lifecycle event script returned a non-zero exit code. What is the BEST approach to resolve this?

⚠ Common exam trap

The trap is looking for a quick workaround like ignoring script failures or manually intervening; candidates must recognize that CodeDeploy has no 'ignoreScriptFailure' option and that the only correct fix is to correct the script and redeploy.

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

✓

Fix the script error in the revision and redeploy.

The deployment failed because the BeforeInstall lifecycle event script returned a non-zero exit code, which CodeDeploy interprets as a failure. The root cause is a bug or misconfiguration in the script itself. The best approach is to fix the script in the application revision and redeploy, ensuring the script exits with 0 on success. This addresses the underlying issue rather than bypassing it.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Set the 'ignoreScriptFailure' option to true in the AppSpec file and redeploy.

    Why it's wrong here

    Setting ignoreScriptFailure to true in the AppSpec file instructs CodeDeploy to proceed with the deployment even when a lifecycle script (such as BeforeInstall or ApplicationStop) exits with a non-zero status. This masks the underlying defect rather than correcting it, allowing the instance to continue with a partially configured or inconsistent application state. As a result, the deployment may report success while the application is broken, and the true root cause remains unaddressed for subsequent deployments.

  • ✗

    Manually run the script on an instance and then resume the deployment.

    Why it's wrong here

    Manually running the script on a single instance only patches that one host's runtime environment; CodeDeploy does not track or replicate that manual change, so other instances that already failed will remain in a failed or inconsistent state. Moreover, CodeDeploy does not support resuming a failed deployment from the point of failure—once a lifecycle event fails, the deployment is marked as failed and you must deploy a corrected revision. This approach treats a systemic artifact problem as a one-off infrastructure issue and provides no durable, automation-friendly fix.

  • ✓

    Fix the script error in the revision and redeploy.

    Why this is correct

    Fixing the script error in the application revision directly addresses the root cause: the failure is deterministic in the artifact, so every instance that runs the same script will encounter the same problem. A subsequent redeployment with the corrected AppSpec or associated script lets CodeDeploy re-run the lifecycle hooks on all target instances, ensuring consistent and reproducible success. This is the standard remediation because CodeDeploy deployments are immutable artifacts—changes must be made in the revision, not on live instances.

  • ✗

    Change the deployment configuration to 'AllAtOnce' to speed up deployment.

    Why it's wrong here

    AllAtOnce alters the deployment configuration to target every instance simultaneously, but it has no effect on the actual script execution or its exit code; the faulty script will still fail and now cause an entire fleet of instances to fail together. This increases the blast radius of the broken script, potentially exceeding your healthy-host tolerance and triggering a rollback of the whole deployment. Deployment configuration choices govern pace and availability thresholds, not the correctness of application scripts, so this change cannot resolve the underlying error.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 1,298 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 DOP-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 DOP-C02 exam.