Step -1 : Launch an EC2 instance in the VPC connected to internet gateway
Step-2: Create an IAM Role having permission of “CloudWatchAgentServer” policy
Step-3: Attach the iam role that you have created to the ec2 instance
Step-4: Make sure that your ec2 instance having public-IPv4 address and DNS host name is turned on
Step-5: Make sure the instance is visible in your fleet manager under the SSM service
Step-6:Go to SSM and select “Run command”, in run command select this type of command “AWS-ConfigureAWSPackage”
Step-7:In name section type “AmazonCloudWatchAgent”
Step-8:In target selection choose the instance manually that has the iam role attached .
Step-9:Leave other option as default and then run the command .
Step-10: Connect to your ec2 instance using remote desktop
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”
Step-12: After running the command select the prompts as per requirement.
Step-13: Go to amazon CloudWatch Metrics , then in custom name spaces you can see the installed CloudWatch agent
Step-14: Through the Cloudwatch Agent metrics you can monitor the RAM utilization of the EC2 instance.