AWS CloudWatch Composite Alarm

This page shows how to write Terraform and CloudFormation for CloudWatch Composite Alarm and write them securely.

aws_cloudwatch_composite_alarm (Terraform)

The Composite Alarm in CloudWatch can be configured in Terraform with the resource name aws_cloudwatch_composite_alarm. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a CloudWatch Composite Alarm resource.

NOTE: An alarm (composite or metric) cannot be destroyed when there are other composite alarms depending on it. This can lead to a cyclical dependency on update, as Terraform will unsuccessfully attempt to destroy alarms before updating the rule. Consider using depends_on, references to alarm names, and two-stage updates.

AWS::CloudWatch::CompositeAlarm (CloudFormation)

The CompositeAlarm in CloudWatch can be configured in CloudFormation with the resource name AWS::CloudWatch::CompositeAlarm. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

Explanation in CloudFormation Registry

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.

Currently, the only alarm actions that can be taken by composite alarms are notifying SNS topics.

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. For a composite alarm, this initial time after creation is the only time that the alarm can be in INSUFFICIENT_DATA state.

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

Frequently asked questions

What is AWS CloudWatch Composite Alarm?

AWS CloudWatch Composite Alarm is a resource for CloudWatch of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.