DOP-C02 Incident and Event Response Practice Question
A company runs a production web application on Amazon ECS with the EC2 launch type. A DevOps engineer needs to automatically restart any ECS task that stops unexpectedly due to a container crash. The tasks are part of a service with a desired count of 4. Which configuration should the engineer implement to meet this requirement?
⚠ Common exam trap
The trap here is assuming that service auto scaling is responsible for replacing failed tasks, when in fact the service scheduler handles task replacement and auto scaling only adjusts the desired count based on load.
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 the ECS service scheduler with a REPLICA scheduling strategy and set the desired count to 4.
The ECS service scheduler with a REPLICA scheduling strategy is designed to maintain a specified number of running tasks. When a task stops due to a container crash or other failure, the scheduler automatically launches a new task to replace it, ensuring the desired count is met. This built-in behavior provides high availability without custom automation. Other options either do not address automatic restart or introduce unnecessary complexity.
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 ECS service to use a daemon scheduling strategy.
Why it's wrong here
A daemon scheduling strategy deploys exactly one task per container instance, which is useful for agents or log collectors, but it does not maintain a desired task count or automatically restart failed tasks. For a service with a fixed desired count, the REPLICA scheduling strategy is required. Daemon services also do not support load balancing or service auto scaling, making them unsuitable for a production web application that needs high availability.
- ✗
Create a CloudWatch alarm that triggers an AWS Lambda function to restart stopped tasks.
Why it's wrong here
While a CloudWatch alarm and Lambda function can be used to react to task failures, this is a custom, complex solution that duplicates the built-in capabilities of the ECS service scheduler. The service scheduler already handles task replacement automatically, so this approach adds unnecessary overhead and potential latency. It is not the recommended or simplest way to ensure tasks are restarted.
- ✓
Use the ECS service scheduler with a REPLICA scheduling strategy and set the desired count to 4.
Why this is correct
The ECS service scheduler with a REPLICA scheduling strategy maintains the desired number of tasks by automatically launching replacement tasks if any task stops or fails. This is the default and correct approach for long-running services that require high availability. The scheduler continuously monitors the service and reconciles the actual state with the desired state, ensuring that the specified count of 4 tasks is always running.
- ✗
Set the ECS service's desired count to 4 and enable service auto scaling.
Why it's wrong here
Setting the desired count to 4 and enabling service auto scaling adjusts the number of tasks based on CloudWatch metrics, but it does not automatically replace tasks that stop unexpectedly. The ECS service scheduler already maintains the desired count by launching replacement tasks when a task stops, so service auto scaling is not the mechanism that ensures task restart. Auto scaling is for scaling in response to load, not for recovering from crashes.
Go deeper
Related to this question
About these practice questions
One of 1,298 original DOP-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 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.