AWS CloudWatch Configuration
Installing CloudWatch Agent on EC2
Create a EC2 instance(Linux)
Creating the IAM Role for ec2 instance
Search for "AmazonEC2RoleforSSM" and "cloudwatchagent" Press Enter
Attach IAM Role to EC2
sudo yum install amazon-cloudwatch-agent -y
Move to the folder where it is installed
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
default choice
Log file path:
/var/log/messages
ec2logforcwagentinstance
cd /opt/aws/amazon-cloudwatch-agent/bin
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json
sudo amazon-linux-extras install epel -y
sudo yum install stress -y(to make loda)
Now go to the EC2-->Cloudwatch