

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# CloudWatch
<a name="AWS_CloudWatch"></a>

**Resource types**
+ [AWS::CloudWatch::Alarm](aws-resource-cloudwatch-alarm.md)
+ [AWS::CloudWatch::AlarmMuteRule](aws-resource-cloudwatch-alarmmuterule.md)
+ [AWS::CloudWatch::AnomalyDetector](aws-resource-cloudwatch-anomalydetector.md)
+ [AWS::CloudWatch::CompositeAlarm](aws-resource-cloudwatch-compositealarm.md)
+ [AWS::CloudWatch::Dashboard](aws-resource-cloudwatch-dashboard.md)
+ [AWS::CloudWatch::InsightRule](aws-resource-cloudwatch-insightrule.md)
+ [AWS::CloudWatch::MetricStream](aws-resource-cloudwatch-metricstream.md)

# AWS::CloudWatch::Alarm
<a name="aws-resource-cloudwatch-alarm"></a>

The `AWS::CloudWatch::Alarm` type specifies an alarm and associates it with the specified metric or metric math expression.

When this operation creates an alarm, the alarm state is immediately set to `INSUFFICIENT_DATA`. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed.

When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.



## Syntax
<a name="aws-resource-cloudwatch-alarm-syntax"></a>

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

### JSON
<a name="aws-resource-cloudwatch-alarm-syntax.json"></a>

```
{
  "Type" : "AWS::CloudWatch::Alarm",
  "Properties" : {
      "[ActionsEnabled](#cfn-cloudwatch-alarm-actionsenabled)" : Boolean,
      "[AlarmActions](#cfn-cloudwatch-alarm-alarmactions)" : [ String, ... ],
      "[AlarmDescription](#cfn-cloudwatch-alarm-alarmdescription)" : String,
      "[AlarmName](#cfn-cloudwatch-alarm-alarmname)" : String,
      "[ComparisonOperator](#cfn-cloudwatch-alarm-comparisonoperator)" : String,
      "[DatapointsToAlarm](#cfn-cloudwatch-alarm-datapointstoalarm)" : Integer,
      "[Dimensions](#cfn-cloudwatch-alarm-dimensions)" : [ Dimension, ... ],
      "[EvaluateLowSampleCountPercentile](#cfn-cloudwatch-alarm-evaluatelowsamplecountpercentile)" : String,
      "[EvaluationCriteria](#cfn-cloudwatch-alarm-evaluationcriteria)" : EvaluationCriteria,
      "[EvaluationInterval](#cfn-cloudwatch-alarm-evaluationinterval)" : Integer,
      "[EvaluationPeriods](#cfn-cloudwatch-alarm-evaluationperiods)" : Integer,
      "[ExtendedStatistic](#cfn-cloudwatch-alarm-extendedstatistic)" : String,
      "[InsufficientDataActions](#cfn-cloudwatch-alarm-insufficientdataactions)" : [ String, ... ],
      "[MetricName](#cfn-cloudwatch-alarm-metricname)" : String,
      "[Metrics](#cfn-cloudwatch-alarm-metrics)" : [ MetricDataQuery, ... ],
      "[Namespace](#cfn-cloudwatch-alarm-namespace)" : String,
      "[OKActions](#cfn-cloudwatch-alarm-okactions)" : [ String, ... ],
      "[Period](#cfn-cloudwatch-alarm-period)" : Integer,
      "[Statistic](#cfn-cloudwatch-alarm-statistic)" : String,
      "[Tags](#cfn-cloudwatch-alarm-tags)" : [ Tag, ... ],
      "[Threshold](#cfn-cloudwatch-alarm-threshold)" : Number,
      "[ThresholdMetricId](#cfn-cloudwatch-alarm-thresholdmetricid)" : String,
      "[TreatMissingData](#cfn-cloudwatch-alarm-treatmissingdata)" : String,
      "[Unit](#cfn-cloudwatch-alarm-unit)" : String
    }
}
```

### YAML
<a name="aws-resource-cloudwatch-alarm-syntax.yaml"></a>

```
Type: AWS::CloudWatch::Alarm
Properties:
  [ActionsEnabled](#cfn-cloudwatch-alarm-actionsenabled): Boolean
  [AlarmActions](#cfn-cloudwatch-alarm-alarmactions): 
    - String
  [AlarmDescription](#cfn-cloudwatch-alarm-alarmdescription): String
  [AlarmName](#cfn-cloudwatch-alarm-alarmname): String
  [ComparisonOperator](#cfn-cloudwatch-alarm-comparisonoperator): String
  [DatapointsToAlarm](#cfn-cloudwatch-alarm-datapointstoalarm): Integer
  [Dimensions](#cfn-cloudwatch-alarm-dimensions): 
    - Dimension
  [EvaluateLowSampleCountPercentile](#cfn-cloudwatch-alarm-evaluatelowsamplecountpercentile): String
  [EvaluationCriteria](#cfn-cloudwatch-alarm-evaluationcriteria): 
    EvaluationCriteria
  [EvaluationInterval](#cfn-cloudwatch-alarm-evaluationinterval): Integer
  [EvaluationPeriods](#cfn-cloudwatch-alarm-evaluationperiods): Integer
  [ExtendedStatistic](#cfn-cloudwatch-alarm-extendedstatistic): String
  [InsufficientDataActions](#cfn-cloudwatch-alarm-insufficientdataactions): 
    - String
  [MetricName](#cfn-cloudwatch-alarm-metricname): String
  [Metrics](#cfn-cloudwatch-alarm-metrics): 
    - MetricDataQuery
  [Namespace](#cfn-cloudwatch-alarm-namespace): String
  [OKActions](#cfn-cloudwatch-alarm-okactions): 
    - String
  [Period](#cfn-cloudwatch-alarm-period): Integer
  [Statistic](#cfn-cloudwatch-alarm-statistic): String
  [Tags](#cfn-cloudwatch-alarm-tags): 
    - Tag
  [Threshold](#cfn-cloudwatch-alarm-threshold): Number
  [ThresholdMetricId](#cfn-cloudwatch-alarm-thresholdmetricid): String
  [TreatMissingData](#cfn-cloudwatch-alarm-treatmissingdata): String
  [Unit](#cfn-cloudwatch-alarm-unit): String
```

## Properties
<a name="aws-resource-cloudwatch-alarm-properties"></a>

`ActionsEnabled`  <a name="cfn-cloudwatch-alarm-actionsenabled"></a>
Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AlarmActions`  <a name="cfn-cloudwatch-alarm-alarmactions"></a>
The list of actions to execute when this alarm transitions into an ALARM state from any other state. Specify each action as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see [PutMetricAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html) in the *Amazon CloudWatch API Reference*.  
*Required*: No  
*Type*: Array of String  
*Maximum*: `5`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AlarmDescription`  <a name="cfn-cloudwatch-alarm-alarmdescription"></a>
The description of the alarm.  
*Required*: No  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AlarmName`  <a name="cfn-cloudwatch-alarm-alarmname"></a>
The name of the alarm. If you don't specify a name, CloudFormation generates a unique physical ID and uses that ID for the alarm name.   
If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`ComparisonOperator`  <a name="cfn-cloudwatch-alarm-comparisonoperator"></a>
The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.  
*Required*: No  
*Type*: String  
*Allowed values*: `GreaterThanOrEqualToThreshold | GreaterThanThreshold | LessThanThreshold | LessThanOrEqualToThreshold | LessThanLowerOrGreaterThanUpperThreshold | LessThanLowerThreshold | GreaterThanUpperThreshold`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DatapointsToAlarm`  <a name="cfn-cloudwatch-alarm-datapointstoalarm"></a>
The number of datapoints that must be breaching to trigger the alarm. This is used only if you are setting an "M out of N" alarm. In that case, this value is the M, and the value that you set for `EvaluationPeriods` is the N value. For more information, see [Evaluating an Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) in the *Amazon CloudWatch User Guide*.  
If you omit this parameter, CloudWatch uses the same value here that you set for `EvaluationPeriods`, and the alarm goes to alarm state if that many consecutive periods are breaching.  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Dimensions`  <a name="cfn-cloudwatch-alarm-dimensions"></a>
The dimensions for the metric associated with the alarm. For an alarm based on a math expression, you can't specify `Dimensions`. Instead, you use `Metrics`.  
*Required*: No  
*Type*: Array of [Dimension](aws-properties-cloudwatch-alarm-dimension.md)  
*Maximum*: `30`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EvaluateLowSampleCountPercentile`  <a name="cfn-cloudwatch-alarm-evaluatelowsamplecountpercentile"></a>
Used only for alarms based on percentiles. If `ignore`, the alarm state does not change during periods with too few data points to be statistically significant. If `evaluate` or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EvaluationCriteria`  <a name="cfn-cloudwatch-alarm-evaluationcriteria"></a>
The evaluation criteria for the alarm.  
*Required*: No  
*Type*: [EvaluationCriteria](aws-properties-cloudwatch-alarm-evaluationcriteria.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EvaluationInterval`  <a name="cfn-cloudwatch-alarm-evaluationinterval"></a>
The frequency, in seconds, at which the alarm is evaluated.  
*Required*: No  
*Type*: Integer  
*Minimum*: `10`  
*Maximum*: `3600`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EvaluationPeriods`  <a name="cfn-cloudwatch-alarm-evaluationperiods"></a>
The number of periods over which data is compared to the specified threshold. If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N, and `DatapointsToAlarm` is the M.  
For more information, see [Evaluating an Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) in the *Amazon CloudWatch User Guide*.  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ExtendedStatistic`  <a name="cfn-cloudwatch-alarm-extendedstatistic"></a>
The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.  
For an alarm based on a metric, you must specify either `Statistic` or `ExtendedStatistic` but not both.  
For an alarm based on a math expression, you can't specify `ExtendedStatistic`. Instead, you use `Metrics`.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InsufficientDataActions`  <a name="cfn-cloudwatch-alarm-insufficientdataactions"></a>
The actions to execute when this alarm transitions to the `INSUFFICIENT_DATA` state from any other state. Each action is specified as an Amazon Resource Name (ARN).  
*Required*: No  
*Type*: Array of String  
*Maximum*: `5`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricName`  <a name="cfn-cloudwatch-alarm-metricname"></a>
The name of the metric associated with the alarm. This is required for an alarm based on a metric. For an alarm based on a math expression, you use `Metrics` instead and you can't specify `MetricName`.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Metrics`  <a name="cfn-cloudwatch-alarm-metrics"></a>
An array that enables you to create an alarm based on the result of a metric math expression. Each item in the array either retrieves a metric or performs a math expression.  
If you specify the `Metrics` parameter, you cannot specify `MetricName`, `Dimensions`, `Period`, `Namespace`, `Statistic`, `ExtendedStatistic`, or `Unit`.   
*Required*: No  
*Type*: Array of [MetricDataQuery](aws-properties-cloudwatch-alarm-metricdataquery.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Namespace`  <a name="cfn-cloudwatch-alarm-namespace"></a>
The namespace of the metric associated with the alarm. This is required for an alarm based on a metric. For an alarm based on a math expression, you can't specify `Namespace` and you use `Metrics` instead.  
For a list of namespaces for metrics from AWS services, see [AWS Services That Publish CloudWatchMetrics. ](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html)  
*Required*: No  
*Type*: String  
*Pattern*: `[^:].*`  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`OKActions`  <a name="cfn-cloudwatch-alarm-okactions"></a>
The actions to execute when this alarm transitions to the `OK` state from any other state. Each action is specified as an Amazon Resource Name (ARN).  
*Required*: No  
*Type*: Array of String  
*Maximum*: `5`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Period`  <a name="cfn-cloudwatch-alarm-period"></a>
The period, in seconds, over which the statistic is applied. This is required for an alarm based on a metric. Valid values are 10, 20, 30, 60, and any multiple of 60.  
For an alarm based on a math expression, you can't specify `Period`, and instead you use the `Metrics` parameter.  
*Minimum:* 10  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Statistic`  <a name="cfn-cloudwatch-alarm-statistic"></a>
The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use `ExtendedStatistic`.  
For an alarm based on a metric, you must specify either `Statistic` or `ExtendedStatistic` but not both.  
For an alarm based on a math expression, you can't specify `Statistic`. Instead, you use `Metrics`.  
*Required*: No  
*Type*: String  
*Allowed values*: `SampleCount | Average | Sum | Minimum | Maximum`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-cloudwatch-alarm-tags"></a>
A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the `cloudwatch:TagResource` permission.  
Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-cloudwatch-alarm-tag.md)  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Threshold`  <a name="cfn-cloudwatch-alarm-threshold"></a>
The value to compare with the specified statistic.  
*Required*: No  
*Type*: Number  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ThresholdMetricId`  <a name="cfn-cloudwatch-alarm-thresholdmetricid"></a>
In an alarm based on an anomaly detection model, this is the ID of the `ANOMALY_DETECTION_BAND` function used as the threshold for the alarm.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TreatMissingData`  <a name="cfn-cloudwatch-alarm-treatmissingdata"></a>
Sets how this alarm is to handle missing data points. Valid values are `breaching`, `notBreaching`, `ignore`, and `missing`. For more information, see [ Configuring How CloudWatchAlarms Treat Missing Data](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data) in the *Amazon CloudWatchUser Guide*.  
If you omit this parameter, the default behavior of `missing` is used.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Unit`  <a name="cfn-cloudwatch-alarm-unit"></a>
The unit of the metric associated with the alarm. Specify this only if you are creating an alarm based on a single metric. Do not specify this if you are specifying a `Metrics` array.  
 You can specify the following values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, or None.  
*Required*: No  
*Type*: String  
*Allowed values*: `Seconds | Microseconds | Milliseconds | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-cloudwatch-alarm-return-values"></a>

### Ref
<a name="aws-resource-cloudwatch-alarm-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the alarm name, such as `TestAlarm`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-cloudwatch-alarm-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-cloudwatch-alarm-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
The ARN of the CloudWatchalarm, such as `arn:aws:cloudwatch:us-west-2:123456789012:alarm:myCloudWatchAlarm-CPUAlarm-UXMMZK36R55Z`.

## Examples
<a name="aws-resource-cloudwatch-alarm--examples"></a>



### Alarm Based on an Anomaly Detector
<a name="aws-resource-cloudwatch-alarm--examples--Alarm_Based_on_an_Anomaly_Detector"></a>

This example creates an alarm that is based on an anomaly detector.

#### JSON
<a name="aws-resource-cloudwatch-alarm--examples--Alarm_Based_on_an_Anomaly_Detector--json"></a>

```
"Resources": {
    "LambdaInvocationsAnomalyDetector": {
       "Type": "AWS::CloudWatch::AnomalyDetector",
       "Properties": {
          "MetricName": "Invocations",
          "Namespace": "AWS/Lambda",
          "Stat": "Sum"
       }
    },
    "LambdaInvocationsAlarm": {
       "Type": "AWS::CloudWatch::Alarm",
       "Properties": {
          "AlarmDescription": "Lambda invocations",
          "AlarmName": "LambdaInvocationsAlarm",
          "ComparisonOperator": "LessThanLowerOrGreaterThanUpperThreshold",
          "EvaluationPeriods": 1,
          "Metrics": [
             {
                "Expression": "ANOMALY_DETECTION_BAND(m1, 2)",
                "Id": "ad1"
             },
             {
                "Id": "m1",
                "MetricStat": {
                   "Metric": {
                      "MetricName": "Invocations",
                      "Namespace": "AWS/Lambda"
                   },
                   "Period": 86400,
                   "Stat": "Sum"
                }
             }
          ],
          "ThresholdMetricId": "ad1",
          "TreatMissingData": "breaching"
       }
    }
 }
```

#### YAML
<a name="aws-resource-cloudwatch-alarm--examples--Alarm_Based_on_an_Anomaly_Detector--yaml"></a>

```
Resources:
  LambdaInvocationsAnomalyDetector:
    Type: AWS::CloudWatch::AnomalyDetector
    Properties:
      MetricName: Invocations
      Namespace: AWS/Lambda
      Stat: Sum

  LambdaInvocationsAlarm:
    Type: AWS::CloudWatch::Alarm
    Properties:
      AlarmDescription: Lambda invocations
      AlarmName: LambdaInvocationsAlarm
      ComparisonOperator: LessThanLowerOrGreaterThanUpperThreshold
      EvaluationPeriods: 1
      Metrics:
      - Expression: ANOMALY_DETECTION_BAND(m1, 2)
        Id: ad1
      - Id: m1
        MetricStat:
          Metric:
            MetricName: Invocations
            Namespace: AWS/Lambda
          Period: !!int 86400
          Stat: Sum
      ThresholdMetricId: ad1
      TreatMissingData: breaching
```

## See also
<a name="aws-resource-cloudwatch-alarm--seealso"></a>
+  [Amazon CloudWatch Template Snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-cloudwatch.html) 



# AWS::CloudWatch::Alarm AlarmPromQLCriteria
<a name="aws-properties-cloudwatch-alarm-alarmpromqlcriteria"></a>

Contains the configuration that determines how a PromQL alarm evaluates its contributors, including the query to run and the durations that define when contributors transition between states.

## Syntax
<a name="aws-properties-cloudwatch-alarm-alarmpromqlcriteria-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-alarm-alarmpromqlcriteria-syntax.json"></a>

```
{
  "[PendingPeriod](#cfn-cloudwatch-alarm-alarmpromqlcriteria-pendingperiod)" : Integer,
  "[Query](#cfn-cloudwatch-alarm-alarmpromqlcriteria-query)" : String,
  "[RecoveryPeriod](#cfn-cloudwatch-alarm-alarmpromqlcriteria-recoveryperiod)" : Integer
}
```

### YAML
<a name="aws-properties-cloudwatch-alarm-alarmpromqlcriteria-syntax.yaml"></a>

```
  [PendingPeriod](#cfn-cloudwatch-alarm-alarmpromqlcriteria-pendingperiod): Integer
  [Query](#cfn-cloudwatch-alarm-alarmpromqlcriteria-query): String
  [RecoveryPeriod](#cfn-cloudwatch-alarm-alarmpromqlcriteria-recoveryperiod): Integer
```

## Properties
<a name="aws-properties-cloudwatch-alarm-alarmpromqlcriteria-properties"></a>

`PendingPeriod`  <a name="cfn-cloudwatch-alarm-alarmpromqlcriteria-pendingperiod"></a>
The duration, in seconds, that a contributor must be continuously breaching before it transitions to the `ALARM` state.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Maximum*: `86400`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Query`  <a name="cfn-cloudwatch-alarm-alarmpromqlcriteria-query"></a>
The PromQL query that the alarm evaluates. The query must return a result of vector type. Each entry in the vector result represents an alarm contributor.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `10000`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RecoveryPeriod`  <a name="cfn-cloudwatch-alarm-alarmpromqlcriteria-recoveryperiod"></a>
The duration, in seconds, that a contributor must continuously not be breaching before it transitions back to the `OK` state.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Maximum*: `86400`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::Alarm Dimension
<a name="aws-properties-cloudwatch-alarm-dimension"></a>

Dimension is an embedded property of the `AWS::CloudWatch::Alarm` type. Dimensions are name/value pairs that can be associated with a CloudWatch metric. You can specify a maximum of 30 dimensions for a given metric.

## Syntax
<a name="aws-properties-cloudwatch-alarm-dimension-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-alarm-dimension-syntax.json"></a>

```
{
  "[Name](#cfn-cloudwatch-alarm-dimension-name)" : String,
  "[Value](#cfn-cloudwatch-alarm-dimension-value)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-alarm-dimension-syntax.yaml"></a>

```
  [Name](#cfn-cloudwatch-alarm-dimension-name): String
  [Value](#cfn-cloudwatch-alarm-dimension-value): String
```

## Properties
<a name="aws-properties-cloudwatch-alarm-dimension-properties"></a>

`Name`  <a name="cfn-cloudwatch-alarm-dimension-name"></a>
The name of the dimension, from 1–255 characters in length. This dimension name must have been included when the metric was published.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-cloudwatch-alarm-dimension-value"></a>
The value for the dimension, from 1–255 characters in length.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-cloudwatch-alarm-dimension--examples"></a>



### Two alarms with dimension values supplied by the Ref function
<a name="aws-properties-cloudwatch-alarm-dimension--examples--Two_alarms_with_dimension_values_supplied_by_the_Ref_function"></a>

The [Ref](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html) and [GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html) intrinsic functions are often used to supply values for CloudWatch metric dimensions. Here is an example using the Ref function.

#### JSON
<a name="aws-properties-cloudwatch-alarm-dimension--examples--Two_alarms_with_dimension_values_supplied_by_the_Ref_function--json"></a>

```
{
    "CPUAlarmHigh": {
        "Type": "AWS::CloudWatch::Alarm",
        "Properties": {
            "AlarmDescription": "Scale-up if CPU is greater than 90% for 10 minutes",
            "MetricName": "CPUUtilization",
            "Namespace": "AWS/EC2",
            "Statistic": "Average",
            "Period": "300",
            "EvaluationPeriods": "2",
            "Threshold": "90",
            "AlarmActions": [
                {
                    "Ref": "WebServerScaleUpPolicy"
                }
            ],
            "Dimensions": [
                {
                    "Name": "AutoScalingGroupName",
                    "Value": {
                        "Ref": "WebServerGroup"
                    }
                }
            ],
            "ComparisonOperator": "GreaterThanThreshold"
        }
    },
    "CPUAlarmLow": {
        "Type": "AWS::CloudWatch::Alarm",
        "Properties": {
            "AlarmDescription": "Scale-down if CPU is less than 70% for 10 minutes",
            "MetricName": "CPUUtilization",
            "Namespace": "AWS/EC2",
            "Statistic": "Average",
            "Period": "300",
            "EvaluationPeriods": "2",
            "Threshold": "70",
            "AlarmActions": [
                {
                    "Ref": "WebServerScaleDownPolicy"
                }
            ],
            "Dimensions": [
                {
                    "Name": "AutoScalingGroupName",
                    "Value": {
                        "Ref": "WebServerGroup"
                    }
                }
            ],
            "ComparisonOperator": "LessThanThreshold"
        }
    }
}
```

#### YAML
<a name="aws-properties-cloudwatch-alarm-dimension--examples--Two_alarms_with_dimension_values_supplied_by_the_Ref_function--yaml"></a>

```
CPUAlarmHigh:
  Type: 'AWS::CloudWatch::Alarm'
  Properties:
    AlarmDescription: Scale-up if CPU is greater than 90% for 10 minutes
    MetricName: CPUUtilization
    Namespace: AWS/EC2
    Statistic: Average
    Period: '300'
    EvaluationPeriods: '2'
    Threshold: '90'
    AlarmActions:
      - !Ref WebServerScaleUpPolicy
    Dimensions:
      - Name: AutoScalingGroupName
        Value: !Ref WebServerGroup
    ComparisonOperator: GreaterThanThreshold
CPUAlarmLow:
  Type: 'AWS::CloudWatch::Alarm'
  Properties:
    AlarmDescription: Scale-down if CPU is less than 70% for 10 minutes
    MetricName: CPUUtilization
    Namespace: AWS/EC2
    Statistic: Average
    Period: '300'
    EvaluationPeriods: '2'
    Threshold: '70'
    AlarmActions:
      - !Ref WebServerScaleDownPolicy
    Dimensions:
      - Name: AutoScalingGroupName
        Value: !Ref WebServerGroup
    ComparisonOperator: LessThanThreshold
```

# AWS::CloudWatch::Alarm EvaluationCriteria
<a name="aws-properties-cloudwatch-alarm-evaluationcriteria"></a>

The evaluation criteria for an alarm. This is a union type that currently supports `PromQLCriteria`.

## Syntax
<a name="aws-properties-cloudwatch-alarm-evaluationcriteria-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-alarm-evaluationcriteria-syntax.json"></a>

```
{
  "[PromQLCriteria](#cfn-cloudwatch-alarm-evaluationcriteria-promqlcriteria)" : AlarmPromQLCriteria
}
```

### YAML
<a name="aws-properties-cloudwatch-alarm-evaluationcriteria-syntax.yaml"></a>

```
  [PromQLCriteria](#cfn-cloudwatch-alarm-evaluationcriteria-promqlcriteria): 
    AlarmPromQLCriteria
```

## Properties
<a name="aws-properties-cloudwatch-alarm-evaluationcriteria-properties"></a>

`PromQLCriteria`  <a name="cfn-cloudwatch-alarm-evaluationcriteria-promqlcriteria"></a>
The PromQL criteria for the alarm evaluation.  
*Required*: No  
*Type*: [AlarmPromQLCriteria](aws-properties-cloudwatch-alarm-alarmpromqlcriteria.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::Alarm Metric
<a name="aws-properties-cloudwatch-alarm-metric"></a>

The `Metric` property type represents a specific metric. `Metric` is a property of the [MetricStat](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html) property type.

## Syntax
<a name="aws-properties-cloudwatch-alarm-metric-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-alarm-metric-syntax.json"></a>

```
{
  "[Dimensions](#cfn-cloudwatch-alarm-metric-dimensions)" : [ Dimension, ... ],
  "[MetricName](#cfn-cloudwatch-alarm-metric-metricname)" : String,
  "[Namespace](#cfn-cloudwatch-alarm-metric-namespace)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-alarm-metric-syntax.yaml"></a>

```
  [Dimensions](#cfn-cloudwatch-alarm-metric-dimensions): 
    - Dimension
  [MetricName](#cfn-cloudwatch-alarm-metric-metricname): String
  [Namespace](#cfn-cloudwatch-alarm-metric-namespace): String
```

## Properties
<a name="aws-properties-cloudwatch-alarm-metric-properties"></a>

`Dimensions`  <a name="cfn-cloudwatch-alarm-metric-dimensions"></a>
The metric dimensions that you want to be used for the metric that the alarm will watch.  
*Required*: No  
*Type*: Array of [Dimension](aws-properties-cloudwatch-alarm-dimension.md)  
*Maximum*: `30`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricName`  <a name="cfn-cloudwatch-alarm-metric-metricname"></a>
The name of the metric that you want the alarm to watch. This is a required field.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Namespace`  <a name="cfn-cloudwatch-alarm-metric-namespace"></a>
The namespace of the metric that the alarm will watch.  
*Required*: No  
*Type*: String  
*Pattern*: `[^:].*`  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::Alarm MetricDataQuery
<a name="aws-properties-cloudwatch-alarm-metricdataquery"></a>

The `MetricDataQuery` property type specifies the metric data to return, and whether this call is just retrieving a batch set of data for one metric, or is performing a math expression on metric data. 

Any expression used must return a single time series. For more information, see [Metric Math Syntax and Functions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) in the *Amazon CloudWatch User Guide*.

## Syntax
<a name="aws-properties-cloudwatch-alarm-metricdataquery-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-alarm-metricdataquery-syntax.json"></a>

```
{
  "[AccountId](#cfn-cloudwatch-alarm-metricdataquery-accountid)" : String,
  "[Expression](#cfn-cloudwatch-alarm-metricdataquery-expression)" : String,
  "[Id](#cfn-cloudwatch-alarm-metricdataquery-id)" : String,
  "[Label](#cfn-cloudwatch-alarm-metricdataquery-label)" : String,
  "[MetricStat](#cfn-cloudwatch-alarm-metricdataquery-metricstat)" : MetricStat,
  "[Period](#cfn-cloudwatch-alarm-metricdataquery-period)" : Integer,
  "[ReturnData](#cfn-cloudwatch-alarm-metricdataquery-returndata)" : Boolean
}
```

### YAML
<a name="aws-properties-cloudwatch-alarm-metricdataquery-syntax.yaml"></a>

```
  [AccountId](#cfn-cloudwatch-alarm-metricdataquery-accountid): String
  [Expression](#cfn-cloudwatch-alarm-metricdataquery-expression): String
  [Id](#cfn-cloudwatch-alarm-metricdataquery-id): String
  [Label](#cfn-cloudwatch-alarm-metricdataquery-label): String
  [MetricStat](#cfn-cloudwatch-alarm-metricdataquery-metricstat): 
    MetricStat
  [Period](#cfn-cloudwatch-alarm-metricdataquery-period): Integer
  [ReturnData](#cfn-cloudwatch-alarm-metricdataquery-returndata): Boolean
```

## Properties
<a name="aws-properties-cloudwatch-alarm-metricdataquery-properties"></a>

`AccountId`  <a name="cfn-cloudwatch-alarm-metricdataquery-accountid"></a>
The ID of the account where the metrics are located, if this is a cross-account alarm.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Expression`  <a name="cfn-cloudwatch-alarm-metricdataquery-expression"></a>
The math expression to be performed on the returned data, if this object is performing a math expression. This expression can use the `Id` of the other metrics to refer to those metrics, and can also use the `Id` of other expressions to use the result of those expressions. For more information about metric math expressions, see [Metric Math Syntax and Functions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) in the *Amazon CloudWatch User Guide*.  
Within each MetricDataQuery object, you must specify either `Expression` or `MetricStat` but not both.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Id`  <a name="cfn-cloudwatch-alarm-metricdataquery-id"></a>
A short name used to tie this object to the results in the response. This name must be unique within a single call to `GetMetricData`. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Label`  <a name="cfn-cloudwatch-alarm-metricdataquery-label"></a>
A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If `Label` is omitted, CloudWatch generates a default.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricStat`  <a name="cfn-cloudwatch-alarm-metricdataquery-metricstat"></a>
The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.  
Within one MetricDataQuery object, you must specify either `Expression` or `MetricStat` but not both.  
*Required*: No  
*Type*: [MetricStat](aws-properties-cloudwatch-alarm-metricstat.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Period`  <a name="cfn-cloudwatch-alarm-metricdataquery-period"></a>
The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a `PutMetricData` operation that includes a `StorageResolution of 1 second`.  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ReturnData`  <a name="cfn-cloudwatch-alarm-metricdataquery-returndata"></a>
This option indicates whether to return the timestamps and raw data values of this metric.  
When you create an alarm based on a metric math expression, specify `True` for this value for only the one math expression that the alarm is based on. You must specify `False` for `ReturnData` for all the other metrics and expressions used in the alarm.  
This field is required.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::Alarm MetricStat
<a name="aws-properties-cloudwatch-alarm-metricstat"></a>

This structure defines the metric to be returned, along with the statistics, period, and units.

`MetricStat` is a property of the [MetricDataQuery](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html) property type.

## Syntax
<a name="aws-properties-cloudwatch-alarm-metricstat-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-alarm-metricstat-syntax.json"></a>

```
{
  "[Metric](#cfn-cloudwatch-alarm-metricstat-metric)" : Metric,
  "[Period](#cfn-cloudwatch-alarm-metricstat-period)" : Integer,
  "[Stat](#cfn-cloudwatch-alarm-metricstat-stat)" : String,
  "[Unit](#cfn-cloudwatch-alarm-metricstat-unit)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-alarm-metricstat-syntax.yaml"></a>

```
  [Metric](#cfn-cloudwatch-alarm-metricstat-metric): 
    Metric
  [Period](#cfn-cloudwatch-alarm-metricstat-period): Integer
  [Stat](#cfn-cloudwatch-alarm-metricstat-stat): String
  [Unit](#cfn-cloudwatch-alarm-metricstat-unit): String
```

## Properties
<a name="aws-properties-cloudwatch-alarm-metricstat-properties"></a>

`Metric`  <a name="cfn-cloudwatch-alarm-metricstat-metric"></a>
The metric to return, including the metric name, namespace, and dimensions.  
*Required*: Yes  
*Type*: [Metric](aws-properties-cloudwatch-alarm-metric.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Period`  <a name="cfn-cloudwatch-alarm-metricstat-period"></a>
The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a `PutMetricData` call that includes a `StorageResolution` of 1 second.  
If the `StartTime` parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:  
+ Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
+ Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
+ Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
*Required*: Yes  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Stat`  <a name="cfn-cloudwatch-alarm-metricstat-stat"></a>
The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in [ Statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic) in the *Amazon CloudWatch User Guide*.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Unit`  <a name="cfn-cloudwatch-alarm-metricstat-unit"></a>
The unit to use for the returned data points.   
Valid values are: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, or None.  
*Required*: No  
*Type*: String  
*Allowed values*: `Seconds | Microseconds | Milliseconds | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::Alarm Tag
<a name="aws-properties-cloudwatch-alarm-tag"></a>

One of the key-value pairs associated with the alarm. Tags can help you organize and categorize your resources. 

## Syntax
<a name="aws-properties-cloudwatch-alarm-tag-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-alarm-tag-syntax.json"></a>

```
{
  "[Key](#cfn-cloudwatch-alarm-tag-key)" : String,
  "[Value](#cfn-cloudwatch-alarm-tag-value)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-alarm-tag-syntax.yaml"></a>

```
  [Key](#cfn-cloudwatch-alarm-tag-key): String
  [Value](#cfn-cloudwatch-alarm-tag-value): String
```

## Properties
<a name="aws-properties-cloudwatch-alarm-tag-properties"></a>

`Key`  <a name="cfn-cloudwatch-alarm-tag-key"></a>
A string that you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-cloudwatch-alarm-tag-value"></a>
The value for the specified tag key.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::AlarmMuteRule
<a name="aws-resource-cloudwatch-alarmmuterule"></a>

Creates or updates an alarm mute rule.

Alarm mute rules automatically mute alarm actions during predefined time windows. When a mute rule is active, targeted alarms continue to evaluate metrics and transition between states, but their configured actions (such as Amazon SNS notifications or Auto Scaling actions) are muted.

You can create mute rules with recurring schedules using `cron` expressions or one-time mute windows using `at` expressions. Each mute rule can target up to 100 specific alarms by name.

If you specify a rule name that already exists, this operation updates the existing rule with the new configuration.

 **Permissions** 

To create or update a mute rule, you must have the `cloudwatch:PutAlarmMuteRule` permission on two types of resources: the alarm mute rule resource itself, and each alarm that the rule targets.

For example, If you want to allow a user to create mute rules that target only specific alarms named "WebServerCPUAlarm" and "DatabaseConnectionAlarm", you would create an IAM policy with one statement granting `cloudwatch:PutAlarmMuteRule` on the alarm mute rule resource (`arn:aws:cloudwatch:[REGION]:123456789012:alarm-mute-rule:*`), and another statement granting `cloudwatch:PutAlarmMuteRule` on the targeted alarm resources (`arn:aws:cloudwatch:[REGION]:123456789012:alarm:WebServerCPUAlarm` and `arn:aws:cloudwatch:[REGION]:123456789012:alarm:DatabaseConnectionAlarm`).

You can also use IAM policy conditions to allow targeting alarms based on resource tags. For example, you can restrict users to create/update mute rules to only target alarms that have a specific tag key-value pair, such as `Team=TeamA`.

## Syntax
<a name="aws-resource-cloudwatch-alarmmuterule-syntax"></a>

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

### JSON
<a name="aws-resource-cloudwatch-alarmmuterule-syntax.json"></a>

```
{
  "Type" : "AWS::CloudWatch::AlarmMuteRule",
  "Properties" : {
      "[Description](#cfn-cloudwatch-alarmmuterule-description)" : String,
      "[ExpireDate](#cfn-cloudwatch-alarmmuterule-expiredate)" : String,
      "[MuteTargets](#cfn-cloudwatch-alarmmuterule-mutetargets)" : MuteTargets,
      "[Name](#cfn-cloudwatch-alarmmuterule-name)" : String,
      "[Rule](#cfn-cloudwatch-alarmmuterule-rule)" : Rule,
      "[StartDate](#cfn-cloudwatch-alarmmuterule-startdate)" : String,
      "[Tags](#cfn-cloudwatch-alarmmuterule-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-cloudwatch-alarmmuterule-syntax.yaml"></a>

```
Type: AWS::CloudWatch::AlarmMuteRule
Properties:
  [Description](#cfn-cloudwatch-alarmmuterule-description): String
  [ExpireDate](#cfn-cloudwatch-alarmmuterule-expiredate): String
  [MuteTargets](#cfn-cloudwatch-alarmmuterule-mutetargets): 
    MuteTargets
  [Name](#cfn-cloudwatch-alarmmuterule-name): String
  [Rule](#cfn-cloudwatch-alarmmuterule-rule): 
    Rule
  [StartDate](#cfn-cloudwatch-alarmmuterule-startdate): String
  [Tags](#cfn-cloudwatch-alarmmuterule-tags): 
    - Tag
```

## Properties
<a name="aws-resource-cloudwatch-alarmmuterule-properties"></a>

`Description`  <a name="cfn-cloudwatch-alarmmuterule-description"></a>
A description of the alarm mute rule that helps you identify its purpose.  
*Required*: No  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ExpireDate`  <a name="cfn-cloudwatch-alarmmuterule-expiredate"></a>
The date and time when the mute rule expires and is no longer evaluated, specified in ISO 8601 format (for example, `2026-12-31T23:59`). After this time, the rule status becomes EXPIRED. This date and time is interpreted according to the schedule timezone, or UTC if no timezone is specified.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MuteTargets`  <a name="cfn-cloudwatch-alarmmuterule-mutetargets"></a>
Specifies which alarms this rule applies to.  
*Required*: No  
*Type*: [MuteTargets](aws-properties-cloudwatch-alarmmuterule-mutetargets.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Name`  <a name="cfn-cloudwatch-alarmmuterule-name"></a>
The name of the alarm mute rule. This name must be unique within your AWS account and region.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Rule`  <a name="cfn-cloudwatch-alarmmuterule-rule"></a>
The configuration that defines when and how long alarms should be muted.  
*Required*: Yes  
*Type*: [Rule](aws-properties-cloudwatch-alarmmuterule-rule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StartDate`  <a name="cfn-cloudwatch-alarmmuterule-startdate"></a>
The date and time when the mute rule becomes active, specified in ISO 8601 format (for example, `2026-04-15T08:00`). If omitted, the rule becomes active immediately upon creation. This date and time is interpreted according to the schedule timezone, or UTC if no timezone is specified.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-cloudwatch-alarmmuterule-tags"></a>
A list of key-value pairs to associate with the alarm mute rule. You can use tags to categorize and manage your mute rules.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-cloudwatch-alarmmuterule-tag.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-cloudwatch-alarmmuterule-return-values"></a>

### Ref
<a name="aws-resource-cloudwatch-alarmmuterule-return-values-ref"></a>

The name of the alarm mute rule.

### Fn::GetAtt
<a name="aws-resource-cloudwatch-alarmmuterule-return-values-fn--getatt"></a>

Retrieves details for a specific alarm mute rule.

This operation returns complete information about the mute rule, including its configuration, status, targeted alarms, and metadata.

The returned status indicates the current state of the mute rule:
+ **SCHEDULED**: The mute rule is configured and will become active in the future
+ **ACTIVE**: The mute rule is currently muting alarm actions
+ **EXPIRED**: The mute rule has passed its expiration date and will no longer become active

 **Permissions** 

To retrieve details for a mute rule, you need the `cloudwatch:GetAlarmMuteRule` permission on the alarm mute rule resource.

#### 
<a name="aws-resource-cloudwatch-alarmmuterule-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
The Amazon Resource Name (ARN) of the alarm mute rule.

`LastUpdatedTimestamp`  <a name="LastUpdatedTimestamp-fn::getatt"></a>
The date and time when the mute rule was last updated.

`MuteType`  <a name="MuteType-fn::getatt"></a>
Indicates whether the mute rule is one-time or recurring. Valid values are `ONE_TIME` or `RECURRING`.

`Status`  <a name="Status-fn::getatt"></a>
The current status of the alarm mute rule. Valid values are `SCHEDULED`, `ACTIVE`, or `EXPIRED`.

# AWS::CloudWatch::AlarmMuteRule MuteTargets
<a name="aws-properties-cloudwatch-alarmmuterule-mutetargets"></a>

Specifies which alarms this rule applies to.

## Syntax
<a name="aws-properties-cloudwatch-alarmmuterule-mutetargets-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-alarmmuterule-mutetargets-syntax.json"></a>

```
{
  "[AlarmNames](#cfn-cloudwatch-alarmmuterule-mutetargets-alarmnames)" : [ String, ... ]
}
```

### YAML
<a name="aws-properties-cloudwatch-alarmmuterule-mutetargets-syntax.yaml"></a>

```
  [AlarmNames](#cfn-cloudwatch-alarmmuterule-mutetargets-alarmnames): 
    - String
```

## Properties
<a name="aws-properties-cloudwatch-alarmmuterule-mutetargets-properties"></a>

`AlarmNames`  <a name="cfn-cloudwatch-alarmmuterule-mutetargets-alarmnames"></a>
Specifies which alarms this rule applies to.  
*Required*: Yes  
*Type*: Array of String  
*Maximum*: `500`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::AlarmMuteRule Rule
<a name="aws-properties-cloudwatch-alarmmuterule-rule"></a>

The configuration that defines when and how long alarms should be muted.

## Syntax
<a name="aws-properties-cloudwatch-alarmmuterule-rule-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-alarmmuterule-rule-syntax.json"></a>

```
{
  "[Schedule](#cfn-cloudwatch-alarmmuterule-rule-schedule)" : Schedule
}
```

### YAML
<a name="aws-properties-cloudwatch-alarmmuterule-rule-syntax.yaml"></a>

```
  [Schedule](#cfn-cloudwatch-alarmmuterule-rule-schedule): 
    Schedule
```

## Properties
<a name="aws-properties-cloudwatch-alarmmuterule-rule-properties"></a>

`Schedule`  <a name="cfn-cloudwatch-alarmmuterule-rule-schedule"></a>
Defines the schedule configuration for an alarm mute rule.  
The rule contains a schedule that specifies when and how long alarms should be muted. The schedule can be a recurring pattern using cron expressions or a one-time mute window using at expressions.  
*Required*: Yes  
*Type*: [Schedule](aws-properties-cloudwatch-alarmmuterule-schedule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::AlarmMuteRule Schedule
<a name="aws-properties-cloudwatch-alarmmuterule-schedule"></a>

Defines the schedule configuration for an alarm mute rule.

The rule contains a schedule that specifies when and how long alarms should be muted. The schedule can be a recurring pattern using cron expressions or a one-time mute window using at expressions.

## Syntax
<a name="aws-properties-cloudwatch-alarmmuterule-schedule-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-alarmmuterule-schedule-syntax.json"></a>

```
{
  "[Duration](#cfn-cloudwatch-alarmmuterule-schedule-duration)" : String,
  "[Expression](#cfn-cloudwatch-alarmmuterule-schedule-expression)" : String,
  "[Timezone](#cfn-cloudwatch-alarmmuterule-schedule-timezone)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-alarmmuterule-schedule-syntax.yaml"></a>

```
  [Duration](#cfn-cloudwatch-alarmmuterule-schedule-duration): String
  [Expression](#cfn-cloudwatch-alarmmuterule-schedule-expression): String
  [Timezone](#cfn-cloudwatch-alarmmuterule-schedule-timezone): String
```

## Properties
<a name="aws-properties-cloudwatch-alarmmuterule-schedule-properties"></a>

`Duration`  <a name="cfn-cloudwatch-alarmmuterule-schedule-duration"></a>
The configuration that defines when and how long alarms should be muted.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Expression`  <a name="cfn-cloudwatch-alarmmuterule-schedule-expression"></a>
The configuration that defines when and how long alarms should be muted.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Timezone`  <a name="cfn-cloudwatch-alarmmuterule-schedule-timezone"></a>
The configuration that defines when and how long alarms should be muted.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::AlarmMuteRule Tag
<a name="aws-properties-cloudwatch-alarmmuterule-tag"></a>

A key-value pair associated with a CloudWatch resource.

## Syntax
<a name="aws-properties-cloudwatch-alarmmuterule-tag-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-alarmmuterule-tag-syntax.json"></a>

```
{
  "[Key](#cfn-cloudwatch-alarmmuterule-tag-key)" : String,
  "[Value](#cfn-cloudwatch-alarmmuterule-tag-value)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-alarmmuterule-tag-syntax.yaml"></a>

```
  [Key](#cfn-cloudwatch-alarmmuterule-tag-key): String
  [Value](#cfn-cloudwatch-alarmmuterule-tag-value): String
```

## Properties
<a name="aws-properties-cloudwatch-alarmmuterule-tag-properties"></a>

`Key`  <a name="cfn-cloudwatch-alarmmuterule-tag-key"></a>
A key-value pair associated with a CloudWatch resource.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-cloudwatch-alarmmuterule-tag-value"></a>
A key-value pair associated with a CloudWatch resource.  
*Required*: Yes  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::AnomalyDetector
<a name="aws-resource-cloudwatch-anomalydetector"></a>

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.

For more information see [ Using CloudWatch anomaly detection.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Anomaly_Detection.html).

## Syntax
<a name="aws-resource-cloudwatch-anomalydetector-syntax"></a>

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

### JSON
<a name="aws-resource-cloudwatch-anomalydetector-syntax.json"></a>

```
{
  "Type" : "AWS::CloudWatch::AnomalyDetector",
  "Properties" : {
      "[Configuration](#cfn-cloudwatch-anomalydetector-configuration)" : Configuration,
      "[Dimensions](#cfn-cloudwatch-anomalydetector-dimensions)" : [ Dimension, ... ],
      "[MetricCharacteristics](#cfn-cloudwatch-anomalydetector-metriccharacteristics)" : MetricCharacteristics,
      "[MetricMathAnomalyDetector](#cfn-cloudwatch-anomalydetector-metricmathanomalydetector)" : MetricMathAnomalyDetector,
      "[MetricName](#cfn-cloudwatch-anomalydetector-metricname)" : String,
      "[Namespace](#cfn-cloudwatch-anomalydetector-namespace)" : String,
      "[SingleMetricAnomalyDetector](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector)" : SingleMetricAnomalyDetector,
      "[Stat](#cfn-cloudwatch-anomalydetector-stat)" : String
    }
}
```

### YAML
<a name="aws-resource-cloudwatch-anomalydetector-syntax.yaml"></a>

```
Type: AWS::CloudWatch::AnomalyDetector
Properties:
  [Configuration](#cfn-cloudwatch-anomalydetector-configuration): 
    Configuration
  [Dimensions](#cfn-cloudwatch-anomalydetector-dimensions): 
    - Dimension
  [MetricCharacteristics](#cfn-cloudwatch-anomalydetector-metriccharacteristics): 
    MetricCharacteristics
  [MetricMathAnomalyDetector](#cfn-cloudwatch-anomalydetector-metricmathanomalydetector): 
    MetricMathAnomalyDetector
  [MetricName](#cfn-cloudwatch-anomalydetector-metricname): String
  [Namespace](#cfn-cloudwatch-anomalydetector-namespace): String
  [SingleMetricAnomalyDetector](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector): 
    SingleMetricAnomalyDetector
  [Stat](#cfn-cloudwatch-anomalydetector-stat): String
```

## Properties
<a name="aws-resource-cloudwatch-anomalydetector-properties"></a>

`Configuration`  <a name="cfn-cloudwatch-anomalydetector-configuration"></a>
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](aws-properties-cloudwatch-anomalydetector-configuration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Dimensions`  <a name="cfn-cloudwatch-anomalydetector-dimensions"></a>
The dimensions of the metric associated with the anomaly detection band.  
*Required*: No  
*Type*: Array of [Dimension](aws-properties-cloudwatch-anomalydetector-dimension.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`MetricCharacteristics`  <a name="cfn-cloudwatch-anomalydetector-metriccharacteristics"></a>
Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models. Currently, it includes the `PeriodicSpikes` parameter.  
*Required*: No  
*Type*: [MetricCharacteristics](aws-properties-cloudwatch-anomalydetector-metriccharacteristics.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`MetricMathAnomalyDetector`  <a name="cfn-cloudwatch-anomalydetector-metricmathanomalydetector"></a>
The CloudWatch metric math expression for this anomaly detector.  
*Required*: No  
*Type*: [MetricMathAnomalyDetector](aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`MetricName`  <a name="cfn-cloudwatch-anomalydetector-metricname"></a>
The name of the metric associated with the anomaly detection band.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Namespace`  <a name="cfn-cloudwatch-anomalydetector-namespace"></a>
The namespace of the metric associated with the anomaly detection band.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`SingleMetricAnomalyDetector`  <a name="cfn-cloudwatch-anomalydetector-singlemetricanomalydetector"></a>
The CloudWatch metric and statistic for this anomaly detector.  
*Required*: No  
*Type*: [SingleMetricAnomalyDetector](aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Stat`  <a name="cfn-cloudwatch-anomalydetector-stat"></a>
The statistic of the metric associated with the anomaly detection band.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-cloudwatch-anomalydetector-return-values"></a>

### Fn::GetAtt
<a name="aws-resource-cloudwatch-anomalydetector-return-values-fn--getatt"></a>

## Examples
<a name="aws-resource-cloudwatch-anomalydetector--examples"></a>



### Anomaly Detector
<a name="aws-resource-cloudwatch-anomalydetector--examples--Anomaly_Detector"></a>

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
<a name="aws-resource-cloudwatch-anomalydetector--examples--Anomaly_Detector--json"></a>

```
{
    "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
<a name="aws-resource-cloudwatch-anomalydetector--examples--Anomaly_Detector--yaml"></a>

```
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
```

# AWS::CloudWatch::AnomalyDetector Configuration
<a name="aws-properties-cloudwatch-anomalydetector-configuration"></a>

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.

## Syntax
<a name="aws-properties-cloudwatch-anomalydetector-configuration-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-anomalydetector-configuration-syntax.json"></a>

```
{
  "[ExcludedTimeRanges](#cfn-cloudwatch-anomalydetector-configuration-excludedtimeranges)" : [ Range, ... ],
  "[MetricTimeZone](#cfn-cloudwatch-anomalydetector-configuration-metrictimezone)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-anomalydetector-configuration-syntax.yaml"></a>

```
  [ExcludedTimeRanges](#cfn-cloudwatch-anomalydetector-configuration-excludedtimeranges): 
    - Range
  [MetricTimeZone](#cfn-cloudwatch-anomalydetector-configuration-metrictimezone): String
```

## Properties
<a name="aws-properties-cloudwatch-anomalydetector-configuration-properties"></a>

`ExcludedTimeRanges`  <a name="cfn-cloudwatch-anomalydetector-configuration-excludedtimeranges"></a>
Specifies an array of time ranges to exclude from use when the anomaly detection model is trained and updated. Use this to make sure that events that could cause unusual values for the metric, such as deployments, aren't used when CloudWatch creates or updates the model.  
*Required*: No  
*Type*: Array of [Range](aws-properties-cloudwatch-anomalydetector-range.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MetricTimeZone`  <a name="cfn-cloudwatch-anomalydetector-configuration-metrictimezone"></a>
The time zone to use for the metric. This is useful to enable the model to automatically account for daylight savings time changes if the metric is sensitive to such time changes.   
To specify a time zone, use the name of the time zone as specified in the standard tz database. For more information, see [tz database](https://en.wikipedia.org/wiki/Tz_database).  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::AnomalyDetector Dimension
<a name="aws-properties-cloudwatch-anomalydetector-dimension"></a>

A dimension is a name/value pair that is part of the identity of a metric. Because dimensions are part of the unique identifier for a metric, whenever you add a unique name/value pair to one of your metrics, you are creating a new variation of that metric. For example, many Amazon EC2 metrics publish `InstanceId` as a dimension name, and the actual instance ID as the value for that dimension.

You can assign up to 30 dimensions to a metric.

## Syntax
<a name="aws-properties-cloudwatch-anomalydetector-dimension-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-anomalydetector-dimension-syntax.json"></a>

```
{
  "[Name](#cfn-cloudwatch-anomalydetector-dimension-name)" : String,
  "[Value](#cfn-cloudwatch-anomalydetector-dimension-value)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-anomalydetector-dimension-syntax.yaml"></a>

```
  [Name](#cfn-cloudwatch-anomalydetector-dimension-name): String
  [Value](#cfn-cloudwatch-anomalydetector-dimension-value): String
```

## Properties
<a name="aws-properties-cloudwatch-anomalydetector-dimension-properties"></a>

`Name`  <a name="cfn-cloudwatch-anomalydetector-dimension-name"></a>
The name of the dimension.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Value`  <a name="cfn-cloudwatch-anomalydetector-dimension-value"></a>
The value of the dimension. Dimension values must contain only ASCII characters and must include at least one non-whitespace character. ASCII control characters are not supported as part of dimension values.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1024`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::CloudWatch::AnomalyDetector Metric
<a name="aws-properties-cloudwatch-anomalydetector-metric"></a>

Represents a specific metric.

## Syntax
<a name="aws-properties-cloudwatch-anomalydetector-metric-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-anomalydetector-metric-syntax.json"></a>

```
{
  "[Dimensions](#cfn-cloudwatch-anomalydetector-metric-dimensions)" : [ Dimension, ... ],
  "[MetricName](#cfn-cloudwatch-anomalydetector-metric-metricname)" : String,
  "[Namespace](#cfn-cloudwatch-anomalydetector-metric-namespace)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-anomalydetector-metric-syntax.yaml"></a>

```
  [Dimensions](#cfn-cloudwatch-anomalydetector-metric-dimensions): 
    - Dimension
  [MetricName](#cfn-cloudwatch-anomalydetector-metric-metricname): String
  [Namespace](#cfn-cloudwatch-anomalydetector-metric-namespace): String
```

## Properties
<a name="aws-properties-cloudwatch-anomalydetector-metric-properties"></a>

`Dimensions`  <a name="cfn-cloudwatch-anomalydetector-metric-dimensions"></a>
The dimensions for the metric.  
*Required*: No  
*Type*: Array of [Dimension](aws-properties-cloudwatch-anomalydetector-dimension.md)  
*Maximum*: `30`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`MetricName`  <a name="cfn-cloudwatch-anomalydetector-metric-metricname"></a>
The name of the metric. This is a required field.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Namespace`  <a name="cfn-cloudwatch-anomalydetector-metric-namespace"></a>
The namespace of the metric.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[^:].*`  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::CloudWatch::AnomalyDetector MetricCharacteristics
<a name="aws-properties-cloudwatch-anomalydetector-metriccharacteristics"></a>

This object includes parameters that you can use to provide information to CloudWatch to help it build more accurate anomaly detection models.

## Syntax
<a name="aws-properties-cloudwatch-anomalydetector-metriccharacteristics-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-anomalydetector-metriccharacteristics-syntax.json"></a>

```
{
  "[PeriodicSpikes](#cfn-cloudwatch-anomalydetector-metriccharacteristics-periodicspikes)" : Boolean
}
```

### YAML
<a name="aws-properties-cloudwatch-anomalydetector-metriccharacteristics-syntax.yaml"></a>

```
  [PeriodicSpikes](#cfn-cloudwatch-anomalydetector-metriccharacteristics-periodicspikes): Boolean
```

## Properties
<a name="aws-properties-cloudwatch-anomalydetector-metriccharacteristics-properties"></a>

`PeriodicSpikes`  <a name="cfn-cloudwatch-anomalydetector-metriccharacteristics-periodicspikes"></a>
Set this parameter to true if values for this metric consistently include spikes that should not be considered to be anomalies. With this set to true, CloudWatch will expect to see spikes that occurred consistently during the model training period, and won't flag future similar spikes as anomalies.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::CloudWatch::AnomalyDetector MetricDataQuery
<a name="aws-properties-cloudwatch-anomalydetector-metricdataquery"></a>

This structure is used in both `GetMetricData` and `PutMetricAlarm`. The supported use of this structure is different for those two operations.

When used in `GetMetricData`, it indicates the metric data to return, and whether this call is just retrieving a batch set of data for one metric, or is performing a Metrics Insights query or a math expression. A single `GetMetricData` call can include up to 500 `MetricDataQuery` structures.

When used in `PutMetricAlarm`, it enables you to create an alarm based on a metric math expression. Each `MetricDataQuery` in the array specifies either a metric to retrieve, or a math expression to be performed on retrieved metrics. A single `PutMetricAlarm` call can include up to 20 `MetricDataQuery` structures in the array. The 20 structures can include as many as 10 structures that contain a `MetricStat` parameter to retrieve a metric, and as many as 10 structures that contain the `Expression` parameter to perform a math expression. Of those `Expression` structures, one must have `true` as the value for `ReturnData`. The result of this expression is the value the alarm watches.

Any expression used in a `PutMetricAlarm` operation must return a single time series. For more information, see [Metric Math Syntax and Functions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) in the *Amazon CloudWatch User Guide*.

Some of the parameters of this structure also have different uses whether you are using this structure in a `GetMetricData` operation or a `PutMetricAlarm` operation. These differences are explained in the following parameter list.

## Syntax
<a name="aws-properties-cloudwatch-anomalydetector-metricdataquery-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-anomalydetector-metricdataquery-syntax.json"></a>

```
{
  "[AccountId](#cfn-cloudwatch-anomalydetector-metricdataquery-accountid)" : String,
  "[Expression](#cfn-cloudwatch-anomalydetector-metricdataquery-expression)" : String,
  "[Id](#cfn-cloudwatch-anomalydetector-metricdataquery-id)" : String,
  "[Label](#cfn-cloudwatch-anomalydetector-metricdataquery-label)" : String,
  "[MetricStat](#cfn-cloudwatch-anomalydetector-metricdataquery-metricstat)" : MetricStat,
  "[Period](#cfn-cloudwatch-anomalydetector-metricdataquery-period)" : Integer,
  "[ReturnData](#cfn-cloudwatch-anomalydetector-metricdataquery-returndata)" : Boolean
}
```

### YAML
<a name="aws-properties-cloudwatch-anomalydetector-metricdataquery-syntax.yaml"></a>

```
  [AccountId](#cfn-cloudwatch-anomalydetector-metricdataquery-accountid): String
  [Expression](#cfn-cloudwatch-anomalydetector-metricdataquery-expression): String
  [Id](#cfn-cloudwatch-anomalydetector-metricdataquery-id): String
  [Label](#cfn-cloudwatch-anomalydetector-metricdataquery-label): String
  [MetricStat](#cfn-cloudwatch-anomalydetector-metricdataquery-metricstat): 
    MetricStat
  [Period](#cfn-cloudwatch-anomalydetector-metricdataquery-period): Integer
  [ReturnData](#cfn-cloudwatch-anomalydetector-metricdataquery-returndata): Boolean
```

## Properties
<a name="aws-properties-cloudwatch-anomalydetector-metricdataquery-properties"></a>

`AccountId`  <a name="cfn-cloudwatch-anomalydetector-metricdataquery-accountid"></a>
The ID of the account where the metrics are located.  
If you are performing a `GetMetricData` operation in a monitoring account, use this to specify which account to retrieve this metric from.  
If you are performing a `PutMetricAlarm` operation, use this to specify which account contains the metric that the alarm is watching.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Expression`  <a name="cfn-cloudwatch-anomalydetector-metricdataquery-expression"></a>
This field can contain either a Metrics Insights query, or a metric math expression to be performed on the returned data. For more information about Metrics Insights queries, see [Metrics Insights query components and syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-querylanguage) in the *Amazon CloudWatch User Guide*.  
A math expression can use the `Id` of the other metrics or queries to refer to those metrics, and can also use the `Id` of other expressions to use the result of those expressions. For more information about metric math expressions, see [Metric Math Syntax and Functions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) in the *Amazon CloudWatch User Guide*.  
Within each MetricDataQuery object, you must specify either `Expression` or `MetricStat` but not both.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Id`  <a name="cfn-cloudwatch-anomalydetector-metricdataquery-id"></a>
A short name used to tie this object to the results in the response. This name must be unique within a single call to `GetMetricData`. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Label`  <a name="cfn-cloudwatch-anomalydetector-metricdataquery-label"></a>
A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If Label is omitted, CloudWatch generates a default.  
You can put dynamic expressions into a label, so that it is more descriptive. For more information, see [Using Dynamic Labels](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html).  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`MetricStat`  <a name="cfn-cloudwatch-anomalydetector-metricdataquery-metricstat"></a>
The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.  
Within one MetricDataQuery object, you must specify either `Expression` or `MetricStat` but not both.  
*Required*: No  
*Type*: [MetricStat](aws-properties-cloudwatch-anomalydetector-metricstat.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Period`  <a name="cfn-cloudwatch-anomalydetector-metricdataquery-period"></a>
The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a `PutMetricData` operation that includes a `StorageResolution of 1 second`.  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`ReturnData`  <a name="cfn-cloudwatch-anomalydetector-metricdataquery-returndata"></a>
When used in `GetMetricData`, this option indicates whether to return the timestamps and raw data values of this metric. If you are performing this call just to do math expressions and do not also need the raw data returned, you can specify `false`. If you omit this, the default of `true` is used.  
When used in `PutMetricAlarm`, specify `true` for the one expression result to use as the alarm. For all other metrics and expressions in the same `PutMetricAlarm` operation, specify `ReturnData` as False.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::CloudWatch::AnomalyDetector MetricMathAnomalyDetector
<a name="aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector"></a>

Indicates the CloudWatch math expression that provides the time series the anomaly detector uses as input. The designated math expression must return a single time series.

## Syntax
<a name="aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector-syntax.json"></a>

```
{
  "[MetricDataQueries](#cfn-cloudwatch-anomalydetector-metricmathanomalydetector-metricdataqueries)" : [ MetricDataQuery, ... ]
}
```

### YAML
<a name="aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector-syntax.yaml"></a>

```
  [MetricDataQueries](#cfn-cloudwatch-anomalydetector-metricmathanomalydetector-metricdataqueries): 
    - MetricDataQuery
```

## Properties
<a name="aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector-properties"></a>

`MetricDataQueries`  <a name="cfn-cloudwatch-anomalydetector-metricmathanomalydetector-metricdataqueries"></a>
An array of metric data query structures that enables you to create an anomaly detector based on the result of a metric math expression. Each item in `MetricDataQueries` gets a metric or performs a math expression. One item in `MetricDataQueries` is the expression that provides the time series that the anomaly detector uses as input. Designate the expression by setting `ReturnData` to `true` for this object in the array. For all other expressions and metrics, set `ReturnData` to `false`. The designated expression must return a single time series.  
*Required*: No  
*Type*: Array of [MetricDataQuery](aws-properties-cloudwatch-anomalydetector-metricdataquery.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::CloudWatch::AnomalyDetector MetricStat
<a name="aws-properties-cloudwatch-anomalydetector-metricstat"></a>

This structure defines the metric to be returned, along with the statistics, period, and units.

## Syntax
<a name="aws-properties-cloudwatch-anomalydetector-metricstat-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-anomalydetector-metricstat-syntax.json"></a>

```
{
  "[Metric](#cfn-cloudwatch-anomalydetector-metricstat-metric)" : Metric,
  "[Period](#cfn-cloudwatch-anomalydetector-metricstat-period)" : Integer,
  "[Stat](#cfn-cloudwatch-anomalydetector-metricstat-stat)" : String,
  "[Unit](#cfn-cloudwatch-anomalydetector-metricstat-unit)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-anomalydetector-metricstat-syntax.yaml"></a>

```
  [Metric](#cfn-cloudwatch-anomalydetector-metricstat-metric): 
    Metric
  [Period](#cfn-cloudwatch-anomalydetector-metricstat-period): Integer
  [Stat](#cfn-cloudwatch-anomalydetector-metricstat-stat): String
  [Unit](#cfn-cloudwatch-anomalydetector-metricstat-unit): String
```

## Properties
<a name="aws-properties-cloudwatch-anomalydetector-metricstat-properties"></a>

`Metric`  <a name="cfn-cloudwatch-anomalydetector-metricstat-metric"></a>
The metric to return, including the metric name, namespace, and dimensions.  
*Required*: Yes  
*Type*: [Metric](aws-properties-cloudwatch-anomalydetector-metric.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Period`  <a name="cfn-cloudwatch-anomalydetector-metricstat-period"></a>
The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a `PutMetricData` call that includes a `StorageResolution` of 1 second.  
If the `StartTime` parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:  
+ Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
+ Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
+ Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
*Required*: Yes  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Stat`  <a name="cfn-cloudwatch-anomalydetector-metricstat-stat"></a>
The statistic to return. It can include any CloudWatch statistic or extended statistic.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Unit`  <a name="cfn-cloudwatch-anomalydetector-metricstat-unit"></a>
When you are using a `Put` operation, this defines what unit you want to use when storing the metric.  
In a `Get` operation, if you omit `Unit` then all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.  
*Required*: No  
*Type*: String  
*Allowed values*: `Seconds | Microseconds | Milliseconds | Bytes | Kilobytes | Megabytes | Gigabytes | Terabytes | Bits | Kilobits | Megabits | Gigabits | Terabits | Percent | Count | Bytes/Second | Kilobytes/Second | Megabytes/Second | Gigabytes/Second | Terabytes/Second | Bits/Second | Kilobits/Second | Megabits/Second | Gigabits/Second | Terabits/Second | Count/Second | None`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::CloudWatch::AnomalyDetector Range
<a name="aws-properties-cloudwatch-anomalydetector-range"></a>

Each `Range` specifies one range of days or times to exclude from use for training or updating an anomaly detection model.

## Syntax
<a name="aws-properties-cloudwatch-anomalydetector-range-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-anomalydetector-range-syntax.json"></a>

```
{
  "[EndTime](#cfn-cloudwatch-anomalydetector-range-endtime)" : String,
  "[StartTime](#cfn-cloudwatch-anomalydetector-range-starttime)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-anomalydetector-range-syntax.yaml"></a>

```
  [EndTime](#cfn-cloudwatch-anomalydetector-range-endtime): String
  [StartTime](#cfn-cloudwatch-anomalydetector-range-starttime): String
```

## Properties
<a name="aws-properties-cloudwatch-anomalydetector-range-properties"></a>

`EndTime`  <a name="cfn-cloudwatch-anomalydetector-range-endtime"></a>
The end time of the range to exclude. The format is `yyyy-MM-dd'T'HH:mm:ss`. For example, `2019-07-01T23:59:59`.   
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StartTime`  <a name="cfn-cloudwatch-anomalydetector-range-starttime"></a>
The start time of the range to exclude. The format is `yyyy-MM-dd'T'HH:mm:ss`. For example, `2019-07-01T23:59:59`.   
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::AnomalyDetector SingleMetricAnomalyDetector
<a name="aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector"></a>

Designates the CloudWatch metric and statistic that provides the time series the anomaly detector uses as input. If you have enabled unified cross-account observability, and this account is a monitoring account, the metric can be in the same account or a source account.

## Syntax
<a name="aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector-syntax.json"></a>

```
{
  "[AccountId](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-accountid)" : String,
  "[Dimensions](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-dimensions)" : [ Dimension, ... ],
  "[MetricName](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-metricname)" : String,
  "[Namespace](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-namespace)" : String,
  "[Stat](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-stat)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector-syntax.yaml"></a>

```
  [AccountId](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-accountid): String
  [Dimensions](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-dimensions): 
    - Dimension
  [MetricName](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-metricname): String
  [Namespace](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-namespace): String
  [Stat](#cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-stat): String
```

## Properties
<a name="aws-properties-cloudwatch-anomalydetector-singlemetricanomalydetector-properties"></a>

`AccountId`  <a name="cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-accountid"></a>
If the CloudWatch metric that provides the time series that the anomaly detector uses as input is in another account, specify that account ID here. If you omit this parameter, the current account is used.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Dimensions`  <a name="cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-dimensions"></a>
The metric dimensions to create the anomaly detection model for.  
*Required*: No  
*Type*: Array of [Dimension](aws-properties-cloudwatch-anomalydetector-dimension.md)  
*Maximum*: `30`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`MetricName`  <a name="cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-metricname"></a>
The name of the metric to create the anomaly detection model for.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Namespace`  <a name="cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-namespace"></a>
The namespace of the metric to create the anomaly detection model for.  
*Required*: No  
*Type*: String  
*Pattern*: `[^:].*`  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Stat`  <a name="cfn-cloudwatch-anomalydetector-singlemetricanomalydetector-stat"></a>
The statistic to use for the metric and anomaly detection model.  
*Required*: No  
*Type*: String  
*Pattern*: `(SampleCount|Average|Sum|Minimum|Maximum|IQM|(p|tc|tm|ts|wm)(\d{1,2}(\.\d{0,10})?|100)|[ou]\d+(\.\d*)?)(_E|_L|_H)?|(TM|TC|TS|WM)\(((((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%)?:((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%|((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%:(((\d{1,2})(\.\d{0,10})?|100(\.0{0,10})?)%)?)\)|(TM|TC|TS|WM|PR)\(((\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)):((\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)))?|((\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)))?:(\d+(\.\d{0,10})?|(\d+(\.\d{0,10})?[Ee][+-]?\d+)))\)`  
*Maximum*: `50`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::CloudWatch::CompositeAlarm
<a name="aws-resource-cloudwatch-compositealarm"></a>

The `AWS::CloudWatch::CompositeAlarm` type creates or updates a composite alarm. When you create a composite alarm, you specify a rule expression for the alarm that takes into account the alarm states of other alarms that you have created. The composite alarm goes into ALARM state only if all conditions of the rule are met.

The alarms specified in a composite alarm's rule expression can include metric alarms and other composite alarms.

Using composite alarms can reduce alarm noise. You can create multiple metric alarms, and also create a composite alarm and set up alerts only for the composite alarm. For example, you could create a composite alarm that goes into ALARM state only when more than one of the underlying metric alarms are in ALARM state.

When this operation creates an alarm, the alarm state is immediately set to INSUFFICIENT\$1DATA. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed. For a composite alarm, this initial time after creation is the only time that the alarm can be in INSUFFICIENT\$1DATA state.

When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.

## Syntax
<a name="aws-resource-cloudwatch-compositealarm-syntax"></a>

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

### JSON
<a name="aws-resource-cloudwatch-compositealarm-syntax.json"></a>

```
{
  "Type" : "AWS::CloudWatch::CompositeAlarm",
  "Properties" : {
      "[ActionsEnabled](#cfn-cloudwatch-compositealarm-actionsenabled)" : Boolean,
      "[ActionsSuppressor](#cfn-cloudwatch-compositealarm-actionssuppressor)" : String,
      "[ActionsSuppressorExtensionPeriod](#cfn-cloudwatch-compositealarm-actionssuppressorextensionperiod)" : Integer,
      "[ActionsSuppressorWaitPeriod](#cfn-cloudwatch-compositealarm-actionssuppressorwaitperiod)" : Integer,
      "[AlarmActions](#cfn-cloudwatch-compositealarm-alarmactions)" : [ String, ... ],
      "[AlarmDescription](#cfn-cloudwatch-compositealarm-alarmdescription)" : String,
      "[AlarmName](#cfn-cloudwatch-compositealarm-alarmname)" : String,
      "[AlarmRule](#cfn-cloudwatch-compositealarm-alarmrule)" : String,
      "[InsufficientDataActions](#cfn-cloudwatch-compositealarm-insufficientdataactions)" : [ String, ... ],
      "[OKActions](#cfn-cloudwatch-compositealarm-okactions)" : [ String, ... ],
      "[Tags](#cfn-cloudwatch-compositealarm-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-cloudwatch-compositealarm-syntax.yaml"></a>

```
Type: AWS::CloudWatch::CompositeAlarm
Properties:
  [ActionsEnabled](#cfn-cloudwatch-compositealarm-actionsenabled): Boolean
  [ActionsSuppressor](#cfn-cloudwatch-compositealarm-actionssuppressor): String
  [ActionsSuppressorExtensionPeriod](#cfn-cloudwatch-compositealarm-actionssuppressorextensionperiod): Integer
  [ActionsSuppressorWaitPeriod](#cfn-cloudwatch-compositealarm-actionssuppressorwaitperiod): Integer
  [AlarmActions](#cfn-cloudwatch-compositealarm-alarmactions): 
    - String
  [AlarmDescription](#cfn-cloudwatch-compositealarm-alarmdescription): String
  [AlarmName](#cfn-cloudwatch-compositealarm-alarmname): String
  [AlarmRule](#cfn-cloudwatch-compositealarm-alarmrule): String
  [InsufficientDataActions](#cfn-cloudwatch-compositealarm-insufficientdataactions): 
    - String
  [OKActions](#cfn-cloudwatch-compositealarm-okactions): 
    - String
  [Tags](#cfn-cloudwatch-compositealarm-tags): 
    - Tag
```

## Properties
<a name="aws-resource-cloudwatch-compositealarm-properties"></a>

`ActionsEnabled`  <a name="cfn-cloudwatch-compositealarm-actionsenabled"></a>
Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. The default is TRUE.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ActionsSuppressor`  <a name="cfn-cloudwatch-compositealarm-actionssuppressor"></a>
 Actions will be suppressed if the suppressor alarm is in the `ALARM` state. `ActionsSuppressor` can be an AlarmName or an Amazon Resource Name (ARN) from an existing alarm.   
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1600`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ActionsSuppressorExtensionPeriod`  <a name="cfn-cloudwatch-compositealarm-actionssuppressorextensionperiod"></a>
 The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of the `ALARM` state. After this time, the composite alarm performs its actions.   
`ExtensionPeriod` is required only when `ActionsSuppressor` is specified. 
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ActionsSuppressorWaitPeriod`  <a name="cfn-cloudwatch-compositealarm-actionssuppressorwaitperiod"></a>
The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into the `ALARM` state. After this time, the composite alarm performs its actions.  
`WaitPeriod` is required only when `ActionsSuppressor` is specified. 
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AlarmActions`  <a name="cfn-cloudwatch-compositealarm-alarmactions"></a>
The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see [PutCompositeAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutCompositeAlarm.html) in the *Amazon CloudWatch API Reference*.  
*Required*: No  
*Type*: Array of String  
*Minimum*: `1`  
*Maximum*: `1024 | 5`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AlarmDescription`  <a name="cfn-cloudwatch-compositealarm-alarmdescription"></a>
The description for the composite alarm.  
*Required*: No  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AlarmName`  <a name="cfn-cloudwatch-compositealarm-alarmname"></a>
The name for the composite alarm. This name must be unique within your AWS account.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`AlarmRule`  <a name="cfn-cloudwatch-compositealarm-alarmrule"></a>
An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. For each alarm that you reference, you designate a function that specifies whether that alarm needs to be in ALARM state, OK state, or INSUFFICIENT\$1DATA state. You can use operators (AND, OR and NOT) to combine multiple functions in a single expression. You can use parenthesis to logically group the functions in your expression.  
You can use either alarm names or ARNs to reference the other alarms that are to be evaluated.  
Functions can include the following:  
+  ALARM("alarm-name or alarm-ARN") is TRUE if the named alarm is in ALARM state. 
+  OK("alarm-name or alarm-ARN") is TRUE if the named alarm is in OK state. 
+  INSUFFICIENT\$1DATA("alarm-name or alarm-ARN") is TRUE if the named alarm is in INSUFFICIENT\$1DATA state. 
+ TRUE always evaluates to TRUE.
+ FALSE always evaluates to FALSE.
 TRUE and FALSE are useful for testing a complex AlarmRule structure, and for testing your alarm actions.  
For more information about `AlarmRule` syntax, see [PutCompositeAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutCompositeAlarm.html) in the *Amazon CloudWatch API Reference*.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `10240`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InsufficientDataActions`  <a name="cfn-cloudwatch-compositealarm-insufficientdataactions"></a>
The actions to execute when this alarm transitions to the INSUFFICIENT\$1DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see [PutCompositeAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutCompositeAlarm.html) in the *Amazon CloudWatch API Reference*.  
*Required*: No  
*Type*: Array of String  
*Minimum*: `1`  
*Maximum*: `1024 | 5`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`OKActions`  <a name="cfn-cloudwatch-compositealarm-okactions"></a>
The actions to execute when this alarm transitions to the OK state from any other state. Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see [PutCompositeAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutCompositeAlarm.html) in the *Amazon CloudWatch API Reference*.  
*Required*: No  
*Type*: Array of String  
*Minimum*: `1`  
*Maximum*: `1024 | 5`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-cloudwatch-compositealarm-tags"></a>
A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the `cloudwatch:TagResource` permission.  
Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-cloudwatch-compositealarm-tag.md)  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-cloudwatch-compositealarm-return-values"></a>

### Ref
<a name="aws-resource-cloudwatch-compositealarm-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the alarm name, such as `MyCompositeAlarm`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-cloudwatch-compositealarm-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-cloudwatch-compositealarm-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
The ARN of the composite alarm, such as `arn:aws:cloudwatch:us-west-2:123456789012:alarm/CompositeAlarmName`.

## Examples
<a name="aws-resource-cloudwatch-compositealarm--examples"></a>



### Composite alarm based on two metric alarms and another composite alarm
<a name="aws-resource-cloudwatch-compositealarm--examples--Composite_alarm_based_on_two_metric_alarms_and_another_composite_alarm"></a>

This example creates composite alarms named "HighResourceUsage" and "DeploymentInProgress", and also creates metrics alarms named "HighCPUUsage" and "HighMemoryUsage". "DeploymentInProgress" is an alarm that must be manually set to TRUE or FALSE. The "HighResourceUsage" alarm goes into ALARM state only if both "HighCPUUsage" and "HighMemoryUsage" are in ALARM state, and if "DeploymentInProgress" is FALSE. Only "HighResourceUsage" has the alarm action of notifying SNS. This reduces alarm noise, so that you are alerted only if both CPU usage and memory usage are high, and a deployment is not currently in progress.

#### JSON
<a name="aws-resource-cloudwatch-compositealarm--examples--Composite_alarm_based_on_two_metric_alarms_and_another_composite_alarm--json"></a>

```
"Resources": {
    "HighResourceUsage": {
        "Type": "AWS::CloudWatch::CompositeAlarm",
        "Properties": {
            "AlarmName": "HighResourceUsage",
            "AlarmRule": "(ALARM(HighCPUUsage) OR ALARM(HighMemoryUsage)) AND NOT ALARM(DeploymentInProgress)",
            "AlarmActions": [ {"arn:aws:sns:us-west-2:123456789012:my-sns-topic"} },
            "AlarmDescription": "Indicates that the system resource usage is high while no known
            deployment is in progress"
        },
        "DependsOn": [
            "DeploymentInProgress",
            "HighCPUUsage",
            "HighMemoryUsage"
        ]
    },
    "DeploymentInProgress": {
        "Type": "AWS::CloudWatch::CompositeAlarm",
        "Properties": {
            "AlarmName": "DeploymentInProgress",
            "AlarmRule": "FALSE",
            "AlarmDescription": "Manually updated to TRUE/FALSE to disable other alarms"
        }
    },
    "HighCPUUsage": {
        "Type": "AWS::CloudWatch::Alarm",
        "Properties": {
            "AlarmDescription": "CPUusageishigh",
            "AlarmName": "HighCPUUsage",
            "ComparisonOperator": "GreaterThanThreshold",
            "EvaluationPeriods": 1,
            "MetricName": "CPUUsage",
            "Namespace": "CustomNamespace",
            "Period": 60,
            "Statistic": "Average",
            "Threshold": 70,
            "TreatMissingData": "notBreaching"
        }
    },
    "HighMemoryUsage": {
        "Type": "AWS::CloudWatch::Alarm",
        "Properties": {
            "AlarmDescription": "Memoryusageishigh",
            "AlarmName": "HighMemoryUsage",
            "ComparisonOperator": "GreaterThanThreshold",
            "EvaluationPeriods": 1,
            "MetricName": "MemoryUsage",
            "Namespace": "CustomNamespace",
            "Period": 60,
            "Statistic": "Average",
            "Threshold": 65,
            "TreatMissingData": "breaching"
        }
    }
}
```

#### YAML
<a name="aws-resource-cloudwatch-compositealarm--examples--Composite_alarm_based_on_two_metric_alarms_and_another_composite_alarm--yaml"></a>

```
Resources:
  HighResourceUsage:
    Type: AWS::CloudWatch::CompositeAlarm
    Properties:
      AlarmName: HighResourceUsage
      AlarmRule: !Sub "(ALARM(${HighCPUUsage}) OR ALARM(${HighMemoryUsage})) AND NOT ALARM(${DeploymentInProgress})"
      AlarmActions: [
         arn:aws:sns:us-west-2:123456789012:my-sns-topic
      ]
      AlarmDescription: Indicates that the system resource usage is high while no known deployment is in progress
    DependsOn:
    - DeploymentInProgress
    - HighCPUUsage
    - HighMemoryUsage
  DeploymentInProgress:
    Type: AWS::CloudWatch::CompositeAlarm
    Properties:
      AlarmName: DeploymentInProgress
      AlarmRule:
      AlarmDescription: Manually updated to TRUE/FALSE to disable other alarms
  HighCPUUsage:
    Type: AWS::CloudWatch::Alarm
    Properties:
      AlarmDescription: CPU usage is high
      AlarmName: HighCPUUsage
      ComparisonOperator: GreaterThanThreshold
      EvaluationPeriods: 1
      MetricName: CPUUsage
      Namespace: CustomNamespace
      Period: 60
      Statistic: Average
      Threshold: 70
      TreatMissingData: notBreaching
  HighMemoryUsage:
    Type: AWS::CloudWatch::Alarm
    Properties:
      AlarmDescription: Memory usage is high
      AlarmName: HighMemoryUsage
      ComparisonOperator: GreaterThanThreshold
      EvaluationPeriods: 1
      MetricName: MemoryUsage
      Namespace: CustomNamespace
      Period: 60
      Statistic: Average
      Threshold: 65
      TreatMissingData: breaching
```

# AWS::CloudWatch::CompositeAlarm Tag
<a name="aws-properties-cloudwatch-compositealarm-tag"></a>

One of the key-value pairs associated with the alarm. Tags can help you organize and categorize your resources. 

## Syntax
<a name="aws-properties-cloudwatch-compositealarm-tag-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-compositealarm-tag-syntax.json"></a>

```
{
  "[Key](#cfn-cloudwatch-compositealarm-tag-key)" : String,
  "[Value](#cfn-cloudwatch-compositealarm-tag-value)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-compositealarm-tag-syntax.yaml"></a>

```
  [Key](#cfn-cloudwatch-compositealarm-tag-key): String
  [Value](#cfn-cloudwatch-compositealarm-tag-value): String
```

## Properties
<a name="aws-properties-cloudwatch-compositealarm-tag-properties"></a>

`Key`  <a name="cfn-cloudwatch-compositealarm-tag-key"></a>
A string that you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-cloudwatch-compositealarm-tag-value"></a>
The value for the specified tag key.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::Dashboard
<a name="aws-resource-cloudwatch-dashboard"></a>

The `AWS::CloudWatch::Dashboard` resource specifies an Amazon CloudWatch dashboard. A dashboard is a customizable home page in the CloudWatch console that you can use to monitor your AWS resources in a single view.

All dashboards in your account are global, not region-specific.

## Syntax
<a name="aws-resource-cloudwatch-dashboard-syntax"></a>

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

### JSON
<a name="aws-resource-cloudwatch-dashboard-syntax.json"></a>

```
{
  "Type" : "AWS::CloudWatch::Dashboard",
  "Properties" : {
      "[DashboardBody](#cfn-cloudwatch-dashboard-dashboardbody)" : String,
      "[DashboardName](#cfn-cloudwatch-dashboard-dashboardname)" : String
    }
}
```

### YAML
<a name="aws-resource-cloudwatch-dashboard-syntax.yaml"></a>

```
Type: AWS::CloudWatch::Dashboard
Properties:
  [DashboardBody](#cfn-cloudwatch-dashboard-dashboardbody): String
  [DashboardName](#cfn-cloudwatch-dashboard-dashboardname): String
```

## Properties
<a name="aws-resource-cloudwatch-dashboard-properties"></a>

`DashboardBody`  <a name="cfn-cloudwatch-dashboard-dashboardbody"></a>
The detailed information about the dashboard in JSON format, including the widgets to include and their location on the dashboard. This parameter is required.  
For more information about the syntax, see [Dashboard Body Structure and Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html).  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DashboardName`  <a name="cfn-cloudwatch-dashboard-dashboardname"></a>
The name of the dashboard. The name must be between 1 and 255 characters. If you do not specify a name, one will be generated automatically.   
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-cloudwatch-dashboard-return-values"></a>

### Ref
<a name="aws-resource-cloudwatch-dashboard-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the value of `DashboardName`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

## See also
<a name="aws-resource-cloudwatch-dashboard--seealso"></a>
+  [Amazon CloudWatch Template Snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-cloudwatch.html) 



# AWS::CloudWatch::InsightRule
<a name="aws-resource-cloudwatch-insightrule"></a>

Creates or updates a Contributor Insights rule. Rules evaluate log events in a CloudWatch Logs log group, enabling you to find contributor data for the log events in that log group. For more information, see [ Using Contributor Insights to Analyze High-Cardinality Data](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights.html) in the *Amazon CloudWatch User Guide*.

## Syntax
<a name="aws-resource-cloudwatch-insightrule-syntax"></a>

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

### JSON
<a name="aws-resource-cloudwatch-insightrule-syntax.json"></a>

```
{
  "Type" : "AWS::CloudWatch::InsightRule",
  "Properties" : {
      "[ApplyOnTransformedLogs](#cfn-cloudwatch-insightrule-applyontransformedlogs)" : Boolean,
      "[RuleBody](#cfn-cloudwatch-insightrule-rulebody)" : String,
      "[RuleName](#cfn-cloudwatch-insightrule-rulename)" : String,
      "[RuleState](#cfn-cloudwatch-insightrule-rulestate)" : String,
      "[Tags](#cfn-cloudwatch-insightrule-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-cloudwatch-insightrule-syntax.yaml"></a>

```
Type: AWS::CloudWatch::InsightRule
Properties:
  [ApplyOnTransformedLogs](#cfn-cloudwatch-insightrule-applyontransformedlogs): Boolean
  [RuleBody](#cfn-cloudwatch-insightrule-rulebody): String
  [RuleName](#cfn-cloudwatch-insightrule-rulename): String
  [RuleState](#cfn-cloudwatch-insightrule-rulestate): String
  [Tags](#cfn-cloudwatch-insightrule-tags): 
    - Tag
```

## Properties
<a name="aws-resource-cloudwatch-insightrule-properties"></a>

`ApplyOnTransformedLogs`  <a name="cfn-cloudwatch-insightrule-applyontransformedlogs"></a>
Determines whether the rules is evaluated on transformed versions of logs. Valid values are `TRUE` and `FALSE`.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RuleBody`  <a name="cfn-cloudwatch-insightrule-rulebody"></a>
The definition of the rule, as a JSON object. For details about the syntax, see [ Contributor Insights Rule Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html) in the *Amazon CloudWatch User Guide*.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RuleName`  <a name="cfn-cloudwatch-insightrule-rulename"></a>
The name of the rule.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`RuleState`  <a name="cfn-cloudwatch-insightrule-rulestate"></a>
The current state of the rule. Valid values are `ENABLED` and `DISABLED`.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-cloudwatch-insightrule-tags"></a>
A list of key-value pairs to associate with the Contributor Insights rule. You can associate as many as 50 tags with a rule.  
Tags can help you organize and categorize your resources. For more information, see [ Tagging Your Amazon CloudWatch Resources](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Tagging.html).  
To be able to associate tags with a rule, you must have the `cloudwatch:TagResource` permission in addition to the `cloudwatch:PutInsightRule` permission.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-cloudwatch-insightrule-tag.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-cloudwatch-insightrule-return-values"></a>

### Ref
<a name="aws-resource-cloudwatch-insightrule-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the ARN of the rule.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-cloudwatch-insightrule-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-cloudwatch-insightrule-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
The ARN of the Contributor Insights rule, such as `arn:aws:cloudwatch:us-west-2:123456789012:insight-rule/MyInsightRuleName`.

`RuleName`  <a name="RuleName-fn::getatt"></a>
The name of the Contributor Insights rule.

# AWS::CloudWatch::InsightRule Tag
<a name="aws-properties-cloudwatch-insightrule-tag"></a>

A key-value pair associated with a CloudWatch resource.

## Syntax
<a name="aws-properties-cloudwatch-insightrule-tag-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-insightrule-tag-syntax.json"></a>

```
{
  "[Key](#cfn-cloudwatch-insightrule-tag-key)" : String,
  "[Value](#cfn-cloudwatch-insightrule-tag-value)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-insightrule-tag-syntax.yaml"></a>

```
  [Key](#cfn-cloudwatch-insightrule-tag-key): String
  [Value](#cfn-cloudwatch-insightrule-tag-value): String
```

## Properties
<a name="aws-properties-cloudwatch-insightrule-tag-properties"></a>

`Key`  <a name="cfn-cloudwatch-insightrule-tag-key"></a>
A string that you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-cloudwatch-insightrule-tag-value"></a>
The value for the specified tag key.  
*Required*: Yes  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::MetricStream
<a name="aws-resource-cloudwatch-metricstream"></a>

Creates or updates a metric stream. Metrics streams can automatically stream CloudWatch metrics to AWS destinations including Amazon S3 and to many third-party solutions. For more information, see [ Metric streams](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Metric-Streams.html). 

To create a metric stream, you must be logged on to an account that has the `iam:PassRole` permission and either the **CloudWatchFullAccess** policy or the `cloudwatch:PutMetricStream` permission. 

When you create or update a metric stream, you choose one of the following:
+ Stream metrics from all metric namespaces in the account.
+ Stream metrics from all metric namespaces in the account, except for the namespaces that you list in `ExcludeFilters`.
+ Stream metrics from only the metric namespaces that you list in `IncludeFilters`. 

When you create a metric stream, the stream is created in the `running` state. If you update an existing metric stream, the state does not change.

If you create a metric stream in an account that has been set up as a monitoring account in CloudWatch cross-account observability, you can choose whether to include metrics from linked source accounts in the metric stream.

## Syntax
<a name="aws-resource-cloudwatch-metricstream-syntax"></a>

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

### JSON
<a name="aws-resource-cloudwatch-metricstream-syntax.json"></a>

```
{
  "Type" : "AWS::CloudWatch::MetricStream",
  "Properties" : {
      "[ExcludeFilters](#cfn-cloudwatch-metricstream-excludefilters)" : [ MetricStreamFilter, ... ],
      "[FirehoseArn](#cfn-cloudwatch-metricstream-firehosearn)" : String,
      "[IncludeFilters](#cfn-cloudwatch-metricstream-includefilters)" : [ MetricStreamFilter, ... ],
      "[IncludeLinkedAccountsMetrics](#cfn-cloudwatch-metricstream-includelinkedaccountsmetrics)" : Boolean,
      "[Name](#cfn-cloudwatch-metricstream-name)" : String,
      "[OutputFormat](#cfn-cloudwatch-metricstream-outputformat)" : String,
      "[RoleArn](#cfn-cloudwatch-metricstream-rolearn)" : String,
      "[StatisticsConfigurations](#cfn-cloudwatch-metricstream-statisticsconfigurations)" : [ MetricStreamStatisticsConfiguration, ... ],
      "[Tags](#cfn-cloudwatch-metricstream-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-cloudwatch-metricstream-syntax.yaml"></a>

```
Type: AWS::CloudWatch::MetricStream
Properties:
  [ExcludeFilters](#cfn-cloudwatch-metricstream-excludefilters): 
    - MetricStreamFilter
  [FirehoseArn](#cfn-cloudwatch-metricstream-firehosearn): String
  [IncludeFilters](#cfn-cloudwatch-metricstream-includefilters): 
    - MetricStreamFilter
  [IncludeLinkedAccountsMetrics](#cfn-cloudwatch-metricstream-includelinkedaccountsmetrics): Boolean
  [Name](#cfn-cloudwatch-metricstream-name): String
  [OutputFormat](#cfn-cloudwatch-metricstream-outputformat): String
  [RoleArn](#cfn-cloudwatch-metricstream-rolearn): String
  [StatisticsConfigurations](#cfn-cloudwatch-metricstream-statisticsconfigurations): 
    - MetricStreamStatisticsConfiguration
  [Tags](#cfn-cloudwatch-metricstream-tags): 
    - Tag
```

## Properties
<a name="aws-resource-cloudwatch-metricstream-properties"></a>

`ExcludeFilters`  <a name="cfn-cloudwatch-metricstream-excludefilters"></a>
If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. You cannot specify both `IncludeFilters` and `ExcludeFilters` in the same metric stream.  
When you modify the `IncludeFilters` or `ExcludeFilters` of an existing metric stream in any way, the metric stream is effectively restarted, so after such a change you will get only the datapoints that have a timestamp after the time of the update.  
*Required*: No  
*Type*: Array of [MetricStreamFilter](aws-properties-cloudwatch-metricstream-metricstreamfilter.md)  
*Maximum*: `1000`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`FirehoseArn`  <a name="cfn-cloudwatch-metricstream-firehosearn"></a>
The ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream. This Amazon Kinesis Firehose delivery stream must already exist and must be in the same account as the metric stream.   
*Required*: No  
*Type*: String  
*Minimum*: `20`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`IncludeFilters`  <a name="cfn-cloudwatch-metricstream-includefilters"></a>
If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. You cannot specify both `IncludeFilters` and `ExcludeFilters` in the same metric stream.  
When you modify the `IncludeFilters` or `ExcludeFilters` of an existing metric stream in any way, the metric stream is effectively restarted, so after such a change you will get only the datapoints that have a timestamp after the time of the update.  
*Required*: No  
*Type*: Array of [MetricStreamFilter](aws-properties-cloudwatch-metricstream-metricstreamfilter.md)  
*Maximum*: `1000`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`IncludeLinkedAccountsMetrics`  <a name="cfn-cloudwatch-metricstream-includelinkedaccountsmetrics"></a>
If you are creating a metric stream in a monitoring account, specify `true` to include metrics from source accounts that are linked to this monitoring account, in the metric stream. The default is `false`.  
For more information about linking accounts, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html)  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Name`  <a name="cfn-cloudwatch-metricstream-name"></a>
If you are creating a new metric stream, this is the name for the new stream. The name must be different than the names of other metric streams in this account and Region.  
If you are updating a metric stream, specify the name of that stream here.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`OutputFormat`  <a name="cfn-cloudwatch-metricstream-outputformat"></a>
The output format for the stream. Valid values are `json`, `opentelemetry1.0` and `opentelemetry0.7` For more information about metric stream output formats, see [ Metric streams output formats](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html).  
This parameter is required.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RoleArn`  <a name="cfn-cloudwatch-metricstream-rolearn"></a>
The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the `firehose:PutRecord` and `firehose:PutRecordBatch` permissions.  
*Required*: No  
*Type*: String  
*Minimum*: `20`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StatisticsConfigurations`  <a name="cfn-cloudwatch-metricstream-statisticsconfigurations"></a>
By default, a metric stream always sends the MAX, MIN, SUM, and SAMPLECOUNT statistics for each metric that is streamed. You can use this parameter to have the metric stream also send additional statistics in the stream. This array can have up to 100 members.  
For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's `OutputFormat`. If the `OutputFormat` is `json`, you can stream any additional statistic that is supported by CloudWatch, listed in [CloudWatch statistics definitions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html). If the `OutputFormat` is OpenTelemetry, you can stream percentile statistics.  
*Required*: No  
*Type*: Array of [MetricStreamStatisticsConfiguration](aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration.md)  
*Maximum*: `100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-cloudwatch-metricstream-tags"></a>
An array of key-value pairs to apply to the metric stream.  
For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).  
*Required*: No  
*Type*: Array of [Tag](aws-properties-cloudwatch-metricstream-tag.md)  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-cloudwatch-metricstream-return-values"></a>

### Ref
<a name="aws-resource-cloudwatch-metricstream-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the name of the metric stream.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-cloudwatch-metricstream-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-cloudwatch-metricstream-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
The ARN of the metric stream.

`CreationDate`  <a name="CreationDate-fn::getatt"></a>
The date that the metric stream was originally created.

`LastUpdateDate`  <a name="LastUpdateDate-fn::getatt"></a>
The date that the metric stream was most recently updated.

`State`  <a name="State-fn::getatt"></a>
The state of the metric stream, either `running` or `stopped`.

## Examples
<a name="aws-resource-cloudwatch-metricstream--examples"></a>

### Metric stream example
<a name="aws-resource-cloudwatch-metricstream--examples--Metric_stream_example"></a>

The following example creates a metric stream that streams only the metrics in the `AWS/ELB` and `AWS/EC2` namespaces.

#### YAML
<a name="aws-resource-cloudwatch-metricstream--examples--Metric_stream_example--yaml"></a>

```
Resources:
  MyMetricStream:
    Type: 'AWS::CloudWatch::MetricStream'
    Properties:
      OutputFormat: 'json'
      FirehoseArn: 'arn:aws:firehose:us-east-1:123456789012:deliverystream/MyDeliveryStream'
      RoleArn: 'arn:aws:iam::123456789012:role/service-role/MyRole'
      IncludeFilters:
        - Namespace: AWS/ELB
        - Namespace: AWS/EC2
```

#### JSON
<a name="aws-resource-cloudwatch-metricstream--examples--Metric_stream_example--json"></a>

```
{
  "Type" : "AWS::CloudWatch::MetricStream",
  "Properties" : {
    "FirehoseArn" : "arn:aws:firehose:us-east-1:123456789012:deliverystream/MyDeliveryStream",
    "IncludeFilters" : [
      {
        "Namespace": "AWS/ELB"
      },
      {
        "Namespace": "AWS/EC2"
      }
    ],
    "Name" : "MyMetricStream",
    "OutputFormat" : "json",
    "RoleArn" : "arn:aws:iam::123456789012:role/service-role/MyRole"
  }
}
```

# AWS::CloudWatch::MetricStream MetricStreamFilter
<a name="aws-properties-cloudwatch-metricstream-metricstreamfilter"></a>

This structure contains a metric namespace and optionally, a list of metric names, to either include in a metric ' stream or exclude from a metric stream.

A metric stream's filters can include up to 1000 total names. This limit applies to the sum of namespace names and metric names in the filters. For example, this could include 10 metric namespace filters with 99 metrics each, or 20 namespace filters with 49 metrics specified in each filter. 

## Syntax
<a name="aws-properties-cloudwatch-metricstream-metricstreamfilter-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-metricstream-metricstreamfilter-syntax.json"></a>

```
{
  "[MetricNames](#cfn-cloudwatch-metricstream-metricstreamfilter-metricnames)" : [ String, ... ],
  "[Namespace](#cfn-cloudwatch-metricstream-metricstreamfilter-namespace)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-metricstream-metricstreamfilter-syntax.yaml"></a>

```
  [MetricNames](#cfn-cloudwatch-metricstream-metricstreamfilter-metricnames): 
    - String
  [Namespace](#cfn-cloudwatch-metricstream-metricstreamfilter-namespace): String
```

## Properties
<a name="aws-properties-cloudwatch-metricstream-metricstreamfilter-properties"></a>

`MetricNames`  <a name="cfn-cloudwatch-metricstream-metricstreamfilter-metricnames"></a>
The names of the metrics to either include or exclude from the metric stream.  
If you omit this parameter, all metrics in the namespace are included or excluded, depending on whether this filter is specified as an exclude filter or an include filter.  
Each metric name can contain only ASCII printable characters (ASCII range 32 through 126). Each metric name must contain at least one non-whitespace character.  
*Required*: No  
*Type*: Array of String  
*Minimum*: `1`  
*Maximum*: `255 | 999`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Namespace`  <a name="cfn-cloudwatch-metricstream-metricstreamfilter-namespace"></a>
The name of the metric namespace in the filter.  
The namespace can contain only ASCII printable characters (ASCII range 32 through 126). It must contain at least one non-whitespace character.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::MetricStream MetricStreamStatisticsConfiguration
<a name="aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration"></a>

This structure specifies a list of additional statistics to stream, and the metrics to stream those additional statistics for.

All metrics that match the combination of metric name and namespace will be streamed with the additional statistics, no matter their dimensions.

## Syntax
<a name="aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration-syntax.json"></a>

```
{
  "[AdditionalStatistics](#cfn-cloudwatch-metricstream-metricstreamstatisticsconfiguration-additionalstatistics)" : [ String, ... ],
  "[IncludeMetrics](#cfn-cloudwatch-metricstream-metricstreamstatisticsconfiguration-includemetrics)" : [ MetricStreamStatisticsMetric, ... ]
}
```

### YAML
<a name="aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration-syntax.yaml"></a>

```
  [AdditionalStatistics](#cfn-cloudwatch-metricstream-metricstreamstatisticsconfiguration-additionalstatistics): 
    - String
  [IncludeMetrics](#cfn-cloudwatch-metricstream-metricstreamstatisticsconfiguration-includemetrics): 
    - MetricStreamStatisticsMetric
```

## Properties
<a name="aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration-properties"></a>

`AdditionalStatistics`  <a name="cfn-cloudwatch-metricstream-metricstreamstatisticsconfiguration-additionalstatistics"></a>
The additional statistics to stream for the metrics listed in `IncludeMetrics`.  
*Required*: Yes  
*Type*: Array of String  
*Maximum*: `20`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`IncludeMetrics`  <a name="cfn-cloudwatch-metricstream-metricstreamstatisticsconfiguration-includemetrics"></a>
An array that defines the metrics that are to have additional statistics streamed.  
*Required*: Yes  
*Type*: Array of [MetricStreamStatisticsMetric](aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric.md)  
*Maximum*: `100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::MetricStream MetricStreamStatisticsMetric
<a name="aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric"></a>

A structure that specifies the metric name and namespace for one metric that is going to have additional statistics included in the stream.

## Syntax
<a name="aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric-syntax.json"></a>

```
{
  "[MetricName](#cfn-cloudwatch-metricstream-metricstreamstatisticsmetric-metricname)" : String,
  "[Namespace](#cfn-cloudwatch-metricstream-metricstreamstatisticsmetric-namespace)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric-syntax.yaml"></a>

```
  [MetricName](#cfn-cloudwatch-metricstream-metricstreamstatisticsmetric-metricname): String
  [Namespace](#cfn-cloudwatch-metricstream-metricstreamstatisticsmetric-namespace): String
```

## Properties
<a name="aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric-properties"></a>

`MetricName`  <a name="cfn-cloudwatch-metricstream-metricstreamstatisticsmetric-metricname"></a>
The name of the metric.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Namespace`  <a name="cfn-cloudwatch-metricstream-metricstreamstatisticsmetric-namespace"></a>
The namespace of the metric.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::CloudWatch::MetricStream Tag
<a name="aws-properties-cloudwatch-metricstream-tag"></a>

A key-value pair associated with a CloudWatch resource.

## Syntax
<a name="aws-properties-cloudwatch-metricstream-tag-syntax"></a>

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

### JSON
<a name="aws-properties-cloudwatch-metricstream-tag-syntax.json"></a>

```
{
  "[Key](#cfn-cloudwatch-metricstream-tag-key)" : String,
  "[Value](#cfn-cloudwatch-metricstream-tag-value)" : String
}
```

### YAML
<a name="aws-properties-cloudwatch-metricstream-tag-syntax.yaml"></a>

```
  [Key](#cfn-cloudwatch-metricstream-tag-key): String
  [Value](#cfn-cloudwatch-metricstream-tag-value): String
```

## Properties
<a name="aws-properties-cloudwatch-metricstream-tag-properties"></a>

`Key`  <a name="cfn-cloudwatch-metricstream-tag-key"></a>
A string that you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-cloudwatch-metricstream-tag-value"></a>
The value for the specified tag key.  
*Required*: Yes  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)