AWS Certified Solutions Architect – Professional — Question 720

A company has an application that is deployed on Amazon EC2 instances behind an Application Load Balancer (ALB). The instances are part of an Auto Scaling group. The application has unpredictable workloads and frequently scales out and in. The company's development team wants to analyze application logs to find ways to improve the application's performance. However, the logs are no longer available after instances scale in.

Which solution will give the development team the ability to view the application logs after a scale-in event?

Answer options

Correct answer: B

Explanation

Configuring the unified CloudWatch agent on the Amazon EC2 instances allows application logs to be continuously streamed and stored in Amazon CloudWatch Logs, preserving them even after the instances are terminated during scale-in. ALB access logs only capture traffic metadata rather than the application-specific logs, while AWS X-Ray is used for request tracing and performance profiling rather than log aggregation. Adjusting the Auto Scaling group's scaling policy does not address the data persistence issue of the logs.