You will need an EC2 instance running Linux, with the AWS CLI tool installed to perform this recipe. If you use an instance based on AWS Linux, you will have the AWS CLI tool installed for you.
The instance role or credentials you use to run the following commands must have permission to submit metrics to CloudWatch. This is the CloudWatch:PutMetricData permission.