Composite Alarm Args
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 the provider will unsuccessfully attempt to destroy alarms before updating the rule. Consider using
depends_on
, references to alarm names, and two-stage updates.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.CompositeAlarm;
import com.pulumi.aws.cloudwatch.CompositeAlarmArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CompositeAlarm("example", CompositeAlarmArgs.builder()
.alarmDescription("This is a composite alarm!")
.alarmName("example-composite-alarm")
.alarmActions(aws_sns_topic.example().arn())
.okActions(aws_sns_topic.example().arn())
.alarmRule("""
ALARM(%s) OR
ALARM(%s)
", aws_cloudwatch_metric_alarm.alpha().alarm_name(),aws_cloudwatch_metric_alarm.bravo().alarm_name()))
.build());
}
}
Import
Use the alarm_name
to import a CloudWatch Composite Alarm. For example
$ pulumi import aws:cloudwatch/compositeAlarm:CompositeAlarm test my-alarm
Constructors
Properties
Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. Defaults to true
.
The set of actions to execute when this alarm transitions to the ALARM
state from any other state. Each action is specified as an ARN. Up to 5 actions are allowed.
The description for the composite alarm.
An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. For syntax, see Creating a Composite Alarm. The maximum length is 10240 characters.
The set of actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other state. Each action is specified as an ARN. Up to 5 actions are allowed.