Forward logs with the CloudWatch agent to CloudWatch Logs and query with Logs Insights
A company has decided to move its fleet of Linux-based web server instances to an Amazon EC2 Auto Scaling group. Currently, the instances are static and are launched manually. When an administrator needs to view log files, the administrator uses SSH to establish a connection to the instances and retrieves the logs manually. The company often needs to query the logs to produce results about application sessions and user issues. The company does not want its new automatically scaling architecture to result in the loss of any log files when instances are scaled in. Which combination of steps should a security engineer take to meet these requirements MOST cost-effectively? (Choose two.)
Community Votes
100% of anonymous learners picked answer CD. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The CloudWatch agent streams logs off-instance to CloudWatch Logs before scale-in, so logs are retained; Logs Insights queries them directly, avoiding Athena/Glue (B) or an EFS volume (E). A cron-to-S3 (A) also survives scale-in but needs Athena for querying, adding cost/complexity versus Logs Insights.
Auto-scaled Linux web servers must not lose logs on scale-in, and logs must be queryable for sessions/user issues, cost-effectively. Install the CloudWatch agent on the instances to forward logs to CloudWatch Logs (surviving termination because logs are already shipped out), and use CloudWatch Logs Insights to query them—no Athena/Glue or shared filesystem needed.
Adding Glue+Athena (B) just to query logs—Logs Insights already queries CloudWatch Logs without that stack. Using EFS (E) as a shared log volume adds cost and is not the most cost-effective centralized approach. A works for retention but pairs poorly with querying versus C+D.
Community Discussion (5 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.