How Should Auto Scaling Applications Preserve Logs for One Year?

Answer Correct answer: C — Configure the CloudWatch agent to stream the application logs to CloudWatch Logs with a one-year retention policy.

A company is running an application on Amazon EC2 instances in an Auto Scaling group. The application stores logs locally. A security engineer noticed that logs were lost after a scale-in event. The security engineer needs to recommend a solution to ensure the durability and availability of log data. All logs must be kept for a minimum of 1 year for auditing purposes. What should the security engineer recommend?

  1. Within the Auto Scaling lifecycle, add a hook to create and attach an Amazon Elastic Block Store (Amazon EBS) log volume each time an EC2 instance is created. When the instance is terminated, the EBS volume can be reattached to another instance for log review.
  2. Create an Amazon Elastic File System (Amazon EFS) file system and add a command in the user data section of the Auto Scaling launch template to mount the EFS file system during EC2 instance creation. Configure a process on the instance to copy the logs once a day from an instance Amazon Elastic Block Store (Amazon EBS) volume to a directory in the EFS file system.
  3. Add an Amazon CloudWatch agent into the AMI used in the Auto Scaling group. Configure the CloudWatch agent to send the logs to Amazon CloudWatch Logs for review. Correct Answer
  4. Within the Auto Scaling lifecycle, add a lifecycle hook at the terminating state transition and alert the engineering team by using a lifecycle notification to Amazon Simple Notification Service (Amazon SNS). Configure the hook to remain in the Terminating:Wait state for 1 hour to allow manual review of the security logs prior to instance termination.

Community Insight

This question tests durable centralized logging versus instance-bound storage; the trap is choosing EFS or EBS because it sounds persistent while overlooking whether logs are continuously shipped before termination.

Local logs on Auto Scaling EC2 instances disappear when scale-in terminates an instance. The durable solution is to stream logs with the CloudWatch agent to CloudWatch Logs and set a one-year retention policy.

A common wrong choice is EFS with a daily copy from the instance EBS volume, because EFS is durable but the once-a-day copy leaves up to a day of logs on an instance that can be terminated during scale-in.

Community Discussion (3 comments)

7f6aef3 👍 1 Selected: C
Resuelve la causa raíz: los logs se envían continuamente fuera de la instancia a un almacenamiento durable (CloudWatch Logs), sobreviviendo a los eventos de scale-in, y con retención configurable a 1 año.
gonzales 👍 1 Selected: C
Push logs continuously off-instance • Fully managed, durable storage Retention policies (≥ 1 year) (!) Auto Scaling safe
bigdata2ml 👍 1 Selected: C
By default, log data is stored in CloudWatch Logs indefinitely. However, you can configure how long to store log data in a log group. Any data older than the current retention setting is deleted. You can change the log retention for each log group at any time.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Option C addresses the root cause: logs are moved continuously off the instance instead of relying on local storage surviving an Auto Scaling event. The CloudWatch agent can be baked into the AMI or supplied through the launch template, and it ships application logs to CloudWatch Logs, which is durable and independent of any single EC2 instance. CloudWatch Logs retention is configured per log group, so the security team can set a retention period of at least one year for auditing. This satisfies both durability and availability while keeping the logs centrally reviewable.

Why the Other Options Are Wrong

Option A creates an EBS log volume per instance and reattaches it after termination, but EBS is Availability Zone-bound and the process is manual, so it does not provide a reliable centralized log archive. Option B uses EFS, which is durable and shared, but the application still writes locally first and the copy runs only once a day, so scale-in can still destroy up to a day of logs. Option D only pauses termination for one hour with a lifecycle hook and SNS notification, which depends on manual review and does not retain logs for the required year. None of these options guarantees that every log record survives an Auto Scaling scale-in event.

Community Comment Notes

All visible learner comments selected option C. As 7f6aef3 framed it, the solution fixes the root cause by continuously sending logs off-instance to durable storage with configurable one-year retention. Gonzales summarized the same reasoning with the phrase "Push logs continuously off-instance" and noted that Auto Scaling becomes safe when logs do not depend on instance lifetime. Bigdata2ml added the useful retention detail that "By default, log data is stored in CloudWatch Logs indefinitely" but retention can be configured per log group, which is exactly how the one-year audit requirement is met.

Official Reference

Exam Strategy

When a question mentions logs disappearing at scale-in and a fixed retention period, prefer continuous shipment to a managed logging service with configurable retention over lifecycle hooks or block storage workarounds. Check whether the proposed fix moves every log record off-instance before termination, not just once a day or after a manual review window.

Frequently Asked Questions

Why doesn't EFS with a daily log copy meet the durability requirement?

The application still writes to local EBS first, so a scale-in before the daily copy loses up to a day of logs. EFS is durable, but the copy process is not continuous.

Can CloudWatch Logs retention be set to one year?

Yes. CloudWatch Logs retention is configured per log group, and you can set it to 365 days or another period that satisfies the audit requirement.

More SCS-C03 FAQ →

Related Analysis

Practice All SCS-C03 Questions

Access 86 questions with complete answers and detailed explanations.

View Full SCS-C03 Practice Test →

← Back to SCS-C03 Study Guide