


Step 4.3: Create the CloudWatch Agent Configuration File We could do this in two ways: 1) Create this config.json file directly 2) Create the CloudWatch agent configuration file with the wizardįor automating purposes I would suggest the First option. This will create a user cwagent, group with relevant permissions and installs the CloudWatch agent Step 1.3: For Select trusted entity, choose AWS service. Step 1.2: In the navigation pane of the IAM console, choose Roles, and then choose to Create role. Step 1.1: Sign in to the AWS Management Console and open the IAM console at. Note : if you already have an IAM role attached to instance then just attach CloudWatchAgentServerPolicy policy to that role As our instance is in EC2 we create an IAM role with the following steps. If you are planning to implement this in an on-premise Ubuntu server, we can do this with IAM users, with programmatic access. Step 1: Create an IAM roleĪs we use CloudWatch we need to authenticate to push metrics. In this post, we see how the CloudWatch agent is installed in Ubuntu 20.04 and how to get memory metrics in the CloudWatch console. By getting the memory metrics in AWS CloudWatch we can set up an Alarm to trigger notifications or any action. So one way to get this done is with the CloudWatch agent. In AWS, for the EC2 instance, we won't get memory metrics by default in CloudWatch.
