CloudWatch Logs

Install and configure the CloudWatch Logs Agent on a Running EC2 Linux Instance

1. Create an IAM role with an appropriate policy to allow the EC2 instance to create logs.

2. Installing AWS Logs Agent.

  • yum -y install awslogs

3. Modify Configuration File.

  • Modify the following configuration file to include the region where you want the log group to be created:

    • /etc/awslogs/awscli.conf

4. Start the AWS Logs Agent.

  • service awslogsd restart (For Amazon Linux 2 AMI).

CloudWatch Events

  • EventBridge is the preferred way to manage your events.

  • CloudWatch Events delivers a near real-time stream of system events that describe changes in AWS resources.

  • Using simple rules that you can quickly set up, you can match events and route them to one or more target functions or streams.

  • CloudWatch Events becomes aware of operational changes as they occur.

Last updated

Was this helpful?