Topic 1 Question 305
A company has a policy that all Amazon EC2 instance logs must be published to Amazon CloudWatch Logs. A SysOps administrator is troubleshooting an EC2 instance that is running Amazon Linux 2. The EC2 instance is not publishing logs to CloudWatch Logs. The Amazon CloudWatch agent is running on the EC2 instance, and the agent configuration file is correct.
What should the SysOps administrator do to resolve the issue?
Configure the AWS CLI on the EC2 instance. Create a cron job that calls the PutLogEvents API operation to push the log files to CloudWatch every 5 minutes.
Inspect the retention period of the CloudWatch Logs log group. Ensure that the retention period is set to a value that is greater than 1 day.
Set up an Amazon Kinesis data stream that is running in the same AWS Region as the EC2 instance. Configure the CloudWatch agent on the EC2 instance to send CloudWatch events to the data stream.
Ensure that the IAM role that is attached to the EC2 instance has permissions in CloudWatch Logs for the CreateLogGroup, CreateLogStream, PutLogEvents, and DescribeLogStreams actions.
ユーザの投票
コメント(2)
- 正解だと思う選択肢: D
D is ok
👍 3rdiaz2023/06/18 - 正解だと思う選択肢: D
D Amazon EC2 instances need the appropriate permissions to interact with Amazon CloudWatch Logs. These permissions are granted through an IAM (Identity and Access Management) role attached to the EC2 instance.
👍 1xile10212023/10/04
シャッフルモード