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, ... ]
, "MetricMathAnomalyDetector" :MetricMathAnomalyDetector
, "MetricName" :String
, "Namespace" :String
, "SingleMetricAnomalyDetector" :SingleMetricAnomalyDetector
, "Stat" :String
} }
YAML
Type: AWS::CloudWatch::AnomalyDetector Properties: Configuration:
Configuration
Dimensions:- Dimension
MetricMathAnomalyDetector:MetricMathAnomalyDetector
MetricName:String
Namespace:String
SingleMetricAnomalyDetector:SingleMetricAnomalyDetector
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
MetricMathAnomalyDetector
-
The CloudWatch metric math expression for this anomaly detector.
Required: No
Type: MetricMathAnomalyDetector
Update requires: Replacement
MetricName
-
The name of the metric associated with the anomaly detection band.
Required: No
Type: String
Update requires: Replacement
Namespace
-
The namespace of the metric associated with the anomaly detection band.
Required: No
Type: String
Update requires: Replacement
SingleMetricAnomalyDetector
-
The CloudWatch metric and statistic for this anomaly detector.
Required: No
Type: SingleMetricAnomalyDetector
Update requires: Replacement
Stat
-
The statistic of the metric associated with the anomaly detection band.
Required: No
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