

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).

# 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)