How to Video:

Prerequisites:

AWS SSM Agent Installed on EC2

Linux image already has the SSM Agent installed. Linux SSM Agent is now installed by default on Amazon Linux AMIs dated 2017.09 and later. You would only need to manually install SSM Agent on other versions of Linux, as described in this article.

IAM Role with the following permissions: AmazonSSMFullAccess

Note: the least privilege permissions needed for the IAM role are AmazonEC2RoleforSSM (a custom policy to allow the action "ssm:GetParameter" to the resource "arn:aws:ssm:*:*:parameter/*", see JSON example)

Attach IAM Role

To configure each Linux EC2 instance through System Manager you need to attach an IAM role with the above permissions to each EC2 instance.

Select the EC2 instance and click on Actions>Instance Settings>Attach/Replace IAM role. Then select the IAM role with the required permissions and click apply (see example below).

Now you should see the role attached to the EC2 instance (see Turbo_CW below)

Note, if you need a scripted approach to add the IAM role to multiple instances please contact Turbonomic Support.

Installing CloudWatch Agent on your Linux Instances

Navigate to the EC2 service under the account and region you'd like to configure

In the navigation pane, under Systems Manager Services, choose Run Command.

In the Command document list, choose AWS-ConfigureAWSPackage

In the Targets area, choose the instance or multiple instances on which to install the CloudWatch agent. If you do not see a specific instance, it might not be configured for Run Command.

In the Action list, choose Install.

In the Name field, type AmazonCloudWatchAgent

Leave Version set to latest to install the latest version of the agent.

Choose Run.

In the end, you should see the status saying Success

Create the Agent Configuration

The CW Agent will be configured to define which metric(s) are being sent to a CW Namespace, and other data required. The following json represents the minimum requirements and cannot be changed.By default, this configuration will store the metrics in the region in which the VM exists.

In addition, you can configure optional parameters of the CW Namespace (CWAgent is the default when not defined), and region (default region where data is located in the region where the instance runs). Note adding more metrics to be collected will not be reflected in Turbonomic – only Used Memory will be collected at this time. Refer to AWS Documentation for more details.

Creating Parameter Store

Now you will need to create a parameter store for the above configuration so it can be deployed across multiple EC2 instances

Navigate the EC2 service under the account and region you'd like to configure

In the navigation pane, choose Parameter Store

If you don't have any Parameter Store then you will see the Welcome Screen. Click on Get Started Now

Copy and paste the json agent configuration you created in the above step into the Value field (also attached below)

Under the Name field, you can enter any name but you must use the same name in the next step, for example, we used CloudWatchLinux

Now click Create ParameterAmazonCloudWatchAgent“Lift-and-vMotion”: a look into VMware on AWS and Azure

Now you should see a message saying it has been created.

Once you click Close you should the Parameter created

CloudWatch_Linux

Deploying The CloudWatch Configuration File

In the navigation pane, choose Run Command.

Click on Run Command once the page loads up

In the Command document list, choose AmazonCloudWatch-ManageAgent

In the Targets area, choose the instance or multiple instances on which you want to deploy CloudWatch Configuration on

Under Action select configure

Under Mode leave it as ec2

Change the Optional Configuration Source to ssm

Under Optional Configuration Location enter the exact same name of the parameter you created in the Parameter Store (previous section). In this example, the parameter is called CloudWatchLinux

Optional Restart should be set to Yes (This will restart the CloudWatch agent, not the instance)