

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