The code examples in this directory demonstrate how to work with Amazon CloudWatch using the AWS SDK for JavaScript v2.
Amazon CloudWatch provides a reliable, scalable, and flexible monitoring solution that you can start using within minutes. You no longer need to set up, manage, and scale your own monitoring systems and infrastructure.
- Delete CloudWatch alarms
- Describe CloudWatch alarms
- Disable CloudWatch alarm actions
- Enable CloudWatch alarm actions
- List CloudWatch metrics
- Put CloudWatch metric alarms
- Put CloudWatch metric data
- As an AWS best practice, grant this code least privilege, or only the permissions required to perform a task. For more information, see Grant least privilege in the AWS Identity and Access Management User Guide.
- This code has not been tested in all AWS Regions. Some AWS services are available only in specific AWS Regions. For more information, see the AWS Regional Services List on the AWS website.
- Running this code might result in charges to your AWS account.
- An AWS account. To create an account, see How do I create and activate a new AWS account on the AWS Premium Support website.
- AWS credentials. For details, see Setting credentials in Node.js in the AWS SDK for Javascript (v2) Developer Guide.
- The AWS SDK for JavaScript (v2). For AWS SDK for JavaScript download and installation instructions, see Installing the AWS SDK for JavaScript in the AWS SDK for JavaScript (v2) Developer Guide.
Most of these code example files can be run with very little to no modification. For example, to use Node.js
to run the cw_deletealarms.js file, replace the hard-coded values in the file with your own values, save the file, and then run the file. For example:
node cw_deletealarms.js