AWS CloudFormation
User Guide (Version )

AWS::CloudWatch::AnomalyDetector

The AWS::CloudWatch::AnomalyDetector type specifies an anomaly detection band for a certain metric and statistic. The band represents the expected "normal" range for the metric values. Anomaly detection bands can be used for visualization of a metric's expected values, and for alarms.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::CloudWatch::AnomalyDetector", "Properties" : { "Configuration" : Configuration, "Dimensions" : [ Dimension, ... ], "MetricName" : String, "Namespace" : String, "Stat" : String } }

YAML

Type: AWS::CloudWatch::AnomalyDetector Properties: Configuration: Configuration Dimensions: - Dimension MetricName: String Namespace: String Stat: String

Properties

Configuration

Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model. The configuration can also include the time zone to use for the metric.

Required: No

Type: Configuration

Update requires: No interruption

Dimensions

The dimensions of the metric associated with the anomaly detection band.

Required: No

Type: List of Dimension

Update requires: Replacement

MetricName

The name of the metric associated with the anomaly detection band.

Required: Yes

Type: String

Update requires: Replacement

Namespace

The namespace of the metric associated with the anomaly detection band.

Required: Yes

Type: String

Update requires: Replacement

Stat

The statistic of the metric associated with the anomaly detection band.

Required: Yes

Type: String

Update requires: Replacement

Examples

Anomaly Detector

This example creates an anomaly detector model for the metric named JvmMetric with the dimension value of UsedMemory. It excludes a time range from the model training.

JSON

{ "Description": "AnomalyDetectorOnUsedMemory", "Resources": { "AnomalyDetectorOnUsedMemory": { "Type": "AWS::CloudWatch::AnomalyDetector", "Properties": { "MetricName": "JvmMetric", "Namespace": "AWSSDK/Java", "Stat": "Average", "Dimensions": [ { "Name": "Memory", "Value": "UsedMemory" } ], "Configuration": { "MetricTimeZone": "UTC", "ExcludedTimeRanges": [ { "StartTime": "2019-07-01T00:00:00", "EndTime": "2019-07-01T23:59:59" } ] } } } } }

YAML

Description: AnomalyDetectorOnUsedMemory Resources: AnomalyDetectorOnUsedMemory: Type: AWS::CloudWatch::AnomalyDetector Properties: MetricName: JvmMetric Namespace: AWSSDK/Java Stat: Average Dimensions: - Name: Memory Value: UsedMemory Configuration: MetricTimeZone: UTC ExcludedTimeRanges: - StartTime: 2019-07-01T00:00:00 EndTime: 2019-07-01T23:59:59

On this page: