Class CompositeAlarm


  • public class CompositeAlarm
    extends com.pulumi.resources.CustomResource
    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 ```java 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 com.pulumi.aws.cloudwatch.inputs.CompositeAlarmActionsSuppressorArgs; 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())) .actionsSuppressor(CompositeAlarmActionsSuppressorArgs.builder() .alarm("suppressor-alarm") .extensionPeriod(10) .waitPeriod(20) .build()) .build()); } } ``` ## Import Using `pulumi import`, import a CloudWatch Composite Alarm using the `alarm_name`. For example: ```sh $ pulumi import aws:cloudwatch/compositeAlarm:CompositeAlarm test my-alarm ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> actionsEnabled()  
      com.pulumi.core.Output<java.util.Optional<CompositeAlarmActionsSuppressor>> actionsSuppressor()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> alarmActions()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> alarmDescription()  
      com.pulumi.core.Output<java.lang.String> alarmName()  
      com.pulumi.core.Output<java.lang.String> alarmRule()  
      com.pulumi.core.Output<java.lang.String> arn()  
      static CompositeAlarm get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, CompositeAlarmState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> insufficientDataActions()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> okActions()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CompositeAlarm

        public CompositeAlarm​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • CompositeAlarm

        public CompositeAlarm​(java.lang.String name,
                              CompositeAlarmArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • CompositeAlarm

        public CompositeAlarm​(java.lang.String name,
                              CompositeAlarmArgs args,
                              @Nullable
                              com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • actionsEnabled

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> actionsEnabled()
        Returns:
        Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. Defaults to `true`.
      • actionsSuppressor

        public com.pulumi.core.Output<java.util.Optional<CompositeAlarmActionsSuppressor>> actionsSuppressor()
        Returns:
        Actions will be suppressed if the suppressor alarm is in the ALARM state.
      • alarmActions

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> alarmActions()
        Returns:
        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.
      • alarmDescription

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> alarmDescription()
        Returns:
        The description for the composite alarm.
      • alarmName

        public com.pulumi.core.Output<java.lang.String> alarmName()
        Returns:
        The name for the composite alarm. This name must be unique within the region.
      • alarmRule

        public com.pulumi.core.Output<java.lang.String> alarmRule()
        Returns:
        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](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Composite_Alarm.html). The maximum length is 10240 characters.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        The ARN of the composite alarm.
      • insufficientDataActions

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> insufficientDataActions()
        Returns:
        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.
      • okActions

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> okActions()
        Returns:
        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.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        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.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
      • get

        public static CompositeAlarm get​(java.lang.String name,
                                         com.pulumi.core.Output<java.lang.String> id,
                                         @Nullable
                                         CompositeAlarmState state,
                                         @Nullable
                                         com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.