nerdexam
Amazon

DOP-C02 · Question #239

A DevOps engineer manages a company's Amazon Elastic Container Service (Amazon ECS) cluster. The cluster runs on several Amazon EC2 instances that are in an Auto Scaling group. The DevOps engineer…

The correct answer is A. Create an Amazon EventBridge rule to capture task state changes. Send the event to Amazon. Explanation Option A is correct because Amazon EventBridge natively integrates with Amazon ECS to capture task state change events, including when tasks stop and the associated stop reason/error codes - making it the most direct and reliable way to log and review stopped task…

Submitted by ricky.ec· Mar 6, 2026Monitoring and Logging

Question

A DevOps engineer manages a company's Amazon Elastic Container Service (Amazon ECS) cluster. The cluster runs on several Amazon EC2 instances that are in an Auto Scaling group. The DevOps engineer must implement a solution that logs and reviews all stopped tasks for errors. Which solution will meet these requirements?

Options

  • ACreate an Amazon EventBridge rule to capture task state changes. Send the event to Amazon
  • BConfigure tasks to write log data in the embedded metric format. Store the logs in Amazon
  • CConfigure the EC2 instances to store logs in Amazon CloudWatch Logs. Create a CloudWatch
  • DConfigure an EC2 Auto Scaling lifecycle hook for the EC2_INSTANCE_TERMINATING scale-in

How the community answered

(56 responses)
  • A
    84% (47)
  • B
    5% (3)
  • C
    9% (5)
  • D
    2% (1)

Explanation

Explanation

Option A is correct because Amazon EventBridge natively integrates with Amazon ECS to capture task state change events, including when tasks stop and the associated stop reason/error codes - making it the most direct and reliable way to log and review stopped task errors by routing events to a target like CloudWatch Logs or SNS for review.

Why the distractors are wrong:

  • Option B focuses on embedded metric format for custom metrics, not specifically capturing stopped task error states - it's designed for metric generation, not event-driven error logging of task lifecycle changes.
  • Option C configures EC2 instance-level logging, which misses the ECS task layer entirely; task stop reasons and errors are ECS-level metadata, not OS-level log data written to disk.
  • Option D uses an Auto Scaling lifecycle hook for instance termination, which is an infrastructure-level event unrelated to ECS task stop events and errors occurring within the cluster.

Memory Tip

Think "Event = EventBridge" - whenever an AWS exam question asks about capturing state changes (task stopped, instance terminated, etc.) for logging or triggering actions, EventBridge is almost always the correct architectural choice because it acts as the central event bus for AWS service events.

Topics

#ECS Monitoring#EventBridge#Log Management#Task State Changes

Community Discussion

No community discussion yet for this question.

Full DOP-C02 Practice