Attach CloudWatch IAM role to selected EC2 Instances

  1. We are now going to attach the IAM Role created on the previous step in one of our EC2 Instances, to do that let’s go to the Amazon EC2 Dashboard. Images/MemInstall01.png

  2. From the EC2 Dashboard, scroll down a bit an click on Launch Instance Images/MemInstall02a.png

  3. Select Linux 2 AMI (HVM) Images/MemInstall02b.png

  4. Select t2.micro (free tier eligible) and click review and launch

    It is possible to assign the IAM role during EC2 creation by clicking “Next: Configure Instance Details”. This lab shows the steps to assign it manually.

    Images/MemInstall02b.png

  5. Click Launch Images/MemInstall02b.png

  6. Select Proceed without a key pair

  7. After the instance is launched and running, select the instance you want to start collecting Memory data and go to Actions on the top bar, select Security » Modify IAM role. Images/MemInstall03.png

  8. Look for the created IAM role CloudWatchAgentServerRole under the IAM role box, select it and apply. Images/MemInstall04.png

  9. Click on the Instance ID and validate the IAM role CloudWatchAgentServerRole is attached to the instance Images/MemInstall06.png