DOP-C02 Resilient Cloud Solutions Practice Question
A company's application runs on Amazon EC2 instances in an Auto Scaling group. The application writes logs to local instance storage. The operations team needs to ensure logs are not lost during instance termination or scaling events. What should be done?
⚠ Common exam trap
Candidates often assume instance store volumes are persistent or that increasing their size provides durability, when in fact instance store volumes are ephemeral and tied to the instance lifecycle, making them unsuitable for critical log data that must survive termination.
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
✓
Install the CloudWatch Logs agent on each instance and stream logs to CloudWatch Logs.
The CloudWatch Logs agent streams log data in near real-time to Amazon CloudWatch Logs, ensuring logs are persisted independently of the EC2 instance lifecycle. This decouples log storage from ephemeral instance store volumes, so logs are not lost during Auto Scaling termination or scaling events. The agent handles log rotation, compression, and encryption in transit, providing a durable and centralized log solution.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the size of the instance store volumes.
Why it's wrong here
Instance store volumes are ephemeral block storage physically attached to the host; any data they contain, including logs, is permanently lost when the EC2 instance is stopped, terminated, or fails. Merely increasing the size of these volumes does not provide durability or centralized access, so log data is still vulnerable to the same lifecycle events that prompted the requirement. To satisfy log-retention objectives you need a destination that exists independently of the instance.
- ✗
Use an Amazon EFS file system and mount it to each instance for log storage.
Why it's wrong here
An Amazon EFS file system provides persistent, shared network storage, so mounting it on each instance does preserve log files even after an instance is terminated. However, the underlying application must be explicitly configured to write logs to the EFS mount point, and EFS itself offers no mechanism to ingest, parse, or forward logs to a monitoring or analytics service. If the application crashes or stops writing before logs are flushed, or if logs are written only to local disk, EFS will not capture them, leaving the same data-loss gap the question asks you to solve.
- ✗
Configure the Auto Scaling group to terminate instances after logs are copied to S3.
Why it's wrong here
Auto Scaling groups do not have any native capability to 'terminate instances after logs are copied to S3'—terminating instances is driven by scaling policies or health checks, not by log-offload completion. Even if you attempted to implement this with custom scripts or lifecycle hooks, a scale-in event or failed copy could terminate the instance before the log transfer finishes, causing permanent loss. The correct pattern is to stream logs continuously to a persistent service rather than relying on termination-time copying.
- ✓
Install the CloudWatch Logs agent on each instance and stream logs to CloudWatch Logs.
Why this is correct
Installing the CloudWatch Logs agent (or the newer unified CloudWatch agent) on each EC2 instance enables real-time delivery of log data to the CloudWatch Logs service, which stores it durably and independently of the instance lifecycle. Because logs are streamed continuously as they are generated, they survive instance termination, crashes, or scale-in events without requiring manual offload steps. This is the AWS-recommended managed solution for centralized log collection and retention.
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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.