

There are more AWS SDK examples available in the [AWS Doc SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples) GitHub repo.

# Code examples for CloudWatch using AWS SDKs
<a name="cloudwatch_code_examples"></a>

The following code examples show you how to use Amazon CloudWatch with an AWS software development kit (SDK).

*Basics* are code examples that show you how to perform the essential operations within a service.

*Actions* are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

*Scenarios* are code examples that show you how to accomplish specific tasks by calling multiple functions within a service or combined with other AWS services.

**More resources**
+  **[ CloudWatch User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html)** – More information about CloudWatch.
+ **[CloudWatch API Reference](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html)** – Details about all available CloudWatch actions.
+ **[AWS Developer Center](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23cloudwatch)** – Code examples that you can filter by category or full-text search.
+ **[AWS SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples)** – GitHub repo with complete code in preferred languages. Includes instructions for setting up and running the code.

**Contents**
+ [Basics](cloudwatch_code_examples_basics.md)
  + [Hello CloudWatch](cloudwatch_example_cloudwatch_Hello_section.md)
  + [Learn the basics](cloudwatch_example_cloudwatch_GetStartedMetricsDashboardsAlarms_section.md)
  + [Actions](cloudwatch_code_examples_actions.md)
    + [`DeleteAlarms`](cloudwatch_example_cloudwatch_DeleteAlarms_section.md)
    + [`DeleteAnomalyDetector`](cloudwatch_example_cloudwatch_DeleteAnomalyDetector_section.md)
    + [`DeleteDashboards`](cloudwatch_example_cloudwatch_DeleteDashboards_section.md)
    + [`DescribeAlarmHistory`](cloudwatch_example_cloudwatch_DescribeAlarmHistory_section.md)
    + [`DescribeAlarms`](cloudwatch_example_cloudwatch_DescribeAlarms_section.md)
    + [`DescribeAlarmsForMetric`](cloudwatch_example_cloudwatch_DescribeAlarmsForMetric_section.md)
    + [`DescribeAnomalyDetectors`](cloudwatch_example_cloudwatch_DescribeAnomalyDetectors_section.md)
    + [`DisableAlarmActions`](cloudwatch_example_cloudwatch_DisableAlarmActions_section.md)
    + [`EnableAlarmActions`](cloudwatch_example_cloudwatch_EnableAlarmActions_section.md)
    + [`GetDashboard`](cloudwatch_example_cloudwatch_GetDashboard_section.md)
    + [`GetMetricData`](cloudwatch_example_cloudwatch_GetMetricData_section.md)
    + [`GetMetricStatistics`](cloudwatch_example_cloudwatch_GetMetricStatistics_section.md)
    + [`GetMetricWidgetImage`](cloudwatch_example_cloudwatch_GetMetricWidgetImage_section.md)
    + [`ListDashboards`](cloudwatch_example_cloudwatch_ListDashboards_section.md)
    + [`ListMetrics`](cloudwatch_example_cloudwatch_ListMetrics_section.md)
    + [`PutAnomalyDetector`](cloudwatch_example_cloudwatch_PutAnomalyDetector_section.md)
    + [`PutDashboard`](cloudwatch_example_cloudwatch_PutDashboard_section.md)
    + [`PutMetricAlarm`](cloudwatch_example_cloudwatch_PutMetricAlarm_section.md)
    + [`PutMetricData`](cloudwatch_example_cloudwatch_PutMetricData_section.md)
+ [Scenarios](cloudwatch_code_examples_scenarios.md)
  + [Creating a CloudWatch dashboard with function name as a variable](cloudwatch_example_cloudwatch_GettingStarted_031_section.md)
  + [Get started with alarms](cloudwatch_example_cloudwatch_Scenario_GettingStarted_section.md)
  + [Manage metrics and alarms](cloudwatch_example_cloudwatch_Usage_MetricsAlarms_section.md)
  + [Monitor DynamoDB performance](cloudwatch_example_cross_MonitorDynamoDB_section.md)
  + [Run CPU stress tests on EC2 instances using FIS](cloudwatch_example_iam_GettingStarted_069_section.md)
  + [Using property variables in CloudWatch dashboards to monitor multiple Lambda functions](cloudwatch_example_iam_GettingStarted_032_section.md)