Step -1 : Launch an EC2 instance in the VPC connected to internet gateway

A screenshot of a computer

Description automatically generated

Step-2: Create an IAM Role having permission of “CloudWatchAgentServer” policy

A screenshot of a computer

Description automatically generated

Step-3: Attach the iam role that you have created to the ec2 instance  

A screenshot of a computer

Description automatically generated

 

A screenshot of a computer

Description automatically generated

Step-4: Make sure that your ec2 instance having public-IPv4 address and DNS host name is turned on

A screenshot of a computer

Description automatically generated

Step-5: Make sure the instance is visible in your fleet manager under the SSM service A screenshot of a computer

Description automatically generated

Step-6:Go to SSM and select “Run command”, in run command select this type of command “AWS-ConfigureAWSPackage

A screenshot of a computer

Description automatically generated

 

A screenshot of a computer

Description automatically generated

 

Step-7:In name section type “AmazonCloudWatchAgent”

A screenshot of a computer

Description automatically generated

 

 

 

Step-8:In target selection choose the instance manually that has the iam role attached .

A screenshot of a computer

Description automatically generated

Step-9:Leave other option as default and then run the command .

A screenshot of a computer

Description automatically generated

 

Step-10: Connect to your ec2 instance using remote desktop 

A screenshot of a computer

Description automatically generated

 

 

Step-11: Open PowerShell as administrator and run the command “cd "C:\Program Files\Amazon\AmazonCloudWatchAgent" and then command run this command “.\amazon-cloudwatch-agent-config-wizard.exe”

 

A screenshot of a computer

Description automatically generated

 

Step-12: After running the command select the prompts as per requirement.

A computer screen with white lines

Description automatically generated

A computer screen with white text

Description automatically generated

A computer screen shot of a black screen

Description automatically generated

 

 

Step-13: Go to amazon CloudWatch Metrics , then in custom name spaces you can see the installed CloudWatch agent

A screenshot of a computer

Description automatically generated

 

Step-14: Through the Cloudwatch Agent metrics you can monitor the RAM utilization of the EC2 instance.