In this document, we will look at how we can configure AWS to get Memory Stats from your Windows instance. This document covers how to do it using AWS SSM Agent (must be installed if not using standard Windows AMI.)
This article will be covering the following:
- Configure JSON File
- Roles Creation
- Assigning Roles
- Deploying JSON File
- AWS SSM Agent Installed - Install SSM Agent
- Amazon EC2 Role for Simple Systems Manager
Configure JSON File
Step 1: Download the JSON file attached at the bottom of this article and use as the template for each AWS account.
Step 2: Copy and then modify the JSON file to match the settings required for VMs in each of the AWS accounts.
You will only need to modify the following fields in the JSON file:
|"Region": "",||Enter the region that will hold the CloudWatch data|
Step 1: Login to your AWS Console and go to your EC2 Instance you would like to Enable CloudWatch on.
Step 2: Right-click on your Instance, Select Instance Settings, Click on Attach/Replace IAM Role.
Step 3: Click Create new IAM role
This step is only required once after that the same role can be applied to all your instances.
Step 4: A new window will open so you can create your new IAM role. Once the page load click on Create new role.
Step 5: Select EC2 then EC2 Role for Simple Systems Manager then Next: Permissions
On the new screen, you should see this. Once you are on that page click on Next Step
Step 6: Now you need to create a new name for the role. In my example, I called it CloudWatch_Turbonomic. You can call it anything you like. After typing in the name click Create role
Now you should see your new role created
Step 1: Now we need to attach this role to the VM we want. Go back to the other page where we can attach the role and click refresh.
Then from the drop-down menu, you should see the new role. Select the role and then click Apply.
Now you should see the Role attached to the VM.
Step 1: On the left-hand side menu select Run Command under System Manager Services
Step 2: Select AWS-ConfigureCloudWatch from the list
Now select the instance or multiple instances you would like to deploy CloudWatch configuration on. Variables in the JSON configuration will be populated as part of the execution (for example, "InstanceId" of VM)
In the properties, section paste your JSON config data and then select Run
In the end, you should see if it's deployed successfully
Now after few minutes you will be able to see stats in your CloudWatch page and Turbonomic will be able to import the Used Memory.
Note: This method refers to using the Run Command to enable CloudWatch metrics via the SSM agent as described here in the AWS documentation AWS Documentation
- Eva Tuczai