A security engineer needs to forward custom application security logs from an Amazon EC2 instance to Amazon CloudWatch. The CloudWatch agent is installed, and the log file paths are added to the agent configuration. The awslogs service is running on the instance, but the logs are not appearing in CloudWatch. What should the engineer do next to resolve the issue?
Choose an answer
Tap an option to check your answer.
Correct answer: Attach the CloudWatchAgentServerPolicy AWS managed policy to the EC2 instance role..
Why this is the answer
The CloudWatch agent requires appropriate permissions to send logs to CloudWatch. Attaching the CloudWatchAgentServerPolicy AWS managed policy to the EC2 instance's IAM role grants these necessary permissions, allowing the agent to successfully publish logs. The other options are incorrect: Adding AWS CloudTrail to the instance role's trust policy is irrelevant; CloudTrail records AWS API calls, it doesn't ingest custom application logs from EC2 instances, nor is it a destination for them. Adding Amazon S3 to the instance role's trust policy and configuring the application to write logs to S3 would be an alternative logging strategy, but it doesn't resolve the issue of the CloudWatch agent not sending logs to CloudWatch. CloudWatch can ingest logs from S3, but the problem states the agent is configured and running. Adding Amazon Inspector to the instance role's trust policy is incorrect. Amazon Inspector is a vulnerability management service, not a log collection or ingestion service. It cannot be used to collect custom application logs.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed