CompositeAlarm

class CompositeAlarm : KotlinCustomResource

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

Properties

Link copied to clipboard
val actionsEnabled: Output<Boolean>?

Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. Defaults to true.

Link copied to clipboard
val alarmActions: Output<List<String>>?

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.

Link copied to clipboard
val alarmDescription: Output<String>?

The description for the composite alarm.

Link copied to clipboard
val alarmName: Output<String>

The name for the composite alarm. This name must be unique within the region.

Link copied to clipboard
val alarmRule: Output<String>

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.

Link copied to clipboard
val arn: Output<String>

The ARN of the composite alarm.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

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.

Link copied to clipboard
val okActions: Output<List<String>>?

The set of actions to execute when this alarm transitions to an OK state from any other state. Each action is specified as an ARN. Up to 5 actions are allowed.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tags: Output<Map<String, String>>?

A map of tags to associate with the alarm. Up to 50 tags are allowed. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urn: Output<String>