Class Alarm


  • public class Alarm
    extends com.pulumi.resources.CustomResource
    This resource allows you to create and manage alarms to trigger based on a set of conditions. Once triggerd a notification will be sent to the assigned recipients. When creating a new instance, there will also be a set of default alarms (cpu, memory and disk) created. All default alarms uses the default recipient for notifications. By setting `no_default_alarms` to *true* in `cloudamqp.Instance`. This will create the instance without default alarms and avoid the need to import them to get full control. Available for all subscription plans, but `lemur`and `tiger`are limited to fewer alarm types. The limited types supported can be seen in the table below in Alarm Type Reference. ## Example Usage ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.cloudamqp.Notification; import com.pulumi.cloudamqp.NotificationArgs; import com.pulumi.cloudamqp.Alarm; import com.pulumi.cloudamqp.AlarmArgs; 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 recipient01 = new Notification("recipient01", NotificationArgs.builder() .instanceId(cloudamqp_instance.instance().id()) .type("email") .value("alarm@example.com") .build()); var cpuAlarm = new Alarm("cpuAlarm", AlarmArgs.builder() .instanceId(cloudamqp_instance.instance().id()) .type("cpu") .enabled(true) .reminderInterval(600) .valueThreshold(95) .timeThreshold(600) .recipients(recipient01.id()) .build()); var memoryAlarm = new Alarm("memoryAlarm", AlarmArgs.builder() .instanceId(cloudamqp_instance.instance().id()) .type("memory") .enabled(true) .reminderInterval(600) .valueThreshold(95) .timeThreshold(600) .recipients(recipient01.id()) .build()); } } ``` ## Alarm Type reference Supported alarm types: `cpu, memory, disk, queue, connection, flow, consumer, netsplit, server_unreachable, notice` Required arguments for all alarms: `instance_id, type, enabled`<br> Optional argument for all alarms: `tags, queue_regex, vhost_regex` | Name | Type | Shared | Dedicated | Required arguments | | ---- | ---- | ---- | ---- | ---- | | CPU | cpu | - | &#10004; | time_threshold, value_threshold | | Memory | memory | - | &#10004; | time_threshold, value_threshold | | Disk space | disk | - | &#10004; | time_threshold, value_threshold | | Queue | queue | &#10004; | &#10004; | time_threshold, value_threshold, queue_regex, vhost_regex, message_type | | Connection | connection | &#10004; | &#10004; | time_threshold, value_threshold | | Connection flow | flow | &#10004; | &#10004; | time_threshold, value_threshold | | Consumer | consumer | &#10004; | &#10004; | time_threshold, value_threshold, queue, vhost | | Netsplit | netsplit | - | &#10004; | time_threshold | | Server unreachable | server_unreachable | - | &#10004; | time_threshold | | Notice | notice | &#10004; | &#10004; | | > Notice alarm is manadatory! Only one can exists and cannot be deleted. Setting `no_default_alarm` to true, will still create this alarm. ## Dependency This resource depends on CloudAMQP instance identifier, `cloudamqp_instance.instance.id`. ## Import `cloudamqp_alarm` can be imported using CloudAMQP internal identifier of the alarm together (CSV separated) with the instance identifier. To retrieve the alarm identifier, use [CloudAMQP API](https://docs.cloudamqp.com/cloudamqp_api.html#list-alarms) ```sh $ pulumi import cloudamqp:index/alarm:Alarm alarm <id>,<instance_id>` ```
    • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      Alarm​(java.lang.String name)  
      Alarm​(java.lang.String name, AlarmArgs args)  
      Alarm​(java.lang.String name, AlarmArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.Boolean> enabled()  
      static Alarm get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, AlarmState 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.lang.Integer> instanceId()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> messageType()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> queueRegex()  
      com.pulumi.core.Output<java.util.List<java.lang.Integer>> recipients()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> reminderInterval()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> timeThreshold()  
      com.pulumi.core.Output<java.lang.String> type()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> valueCalculation()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> valueThreshold()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> vhostRegex()  
      • 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

      • Alarm

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

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

        public Alarm​(java.lang.String name,
                     AlarmArgs 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

      • enabled

        public com.pulumi.core.Output<java.lang.Boolean> enabled()
        Returns:
        Enable or disable the alarm to trigger.
      • instanceId

        public com.pulumi.core.Output<java.lang.Integer> instanceId()
        Returns:
        The CloudAMQP instance ID.
      • messageType

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> messageType()
        Returns:
        Message type `(total, unacked, ready)` used by queue alarm type. Specific argument for `disk` alarm
      • queueRegex

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> queueRegex()
        Returns:
        Regex for which queue to check.
      • recipients

        public com.pulumi.core.Output<java.util.List<java.lang.Integer>> recipients()
        Returns:
        Identifier for recipient to be notified. Leave empty to notify all recipients.
      • reminderInterval

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> reminderInterval()
        Returns:
        The reminder interval (in seconds) to resend the alarm if not resolved. Set to 0 for no reminders. The Default is 0.
      • timeThreshold

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> timeThreshold()
        Returns:
        The time interval (in seconds) the `value_threshold` should be active before triggering an alarm.
      • type

        public com.pulumi.core.Output<java.lang.String> type()
        Returns:
        The alarm type, see valid options below.
      • valueCalculation

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> valueCalculation()
        Returns:
        Disk value threshold calculation, `fixed, percentage` of disk space remaining. Based on alarm type, different arguments are flagged as required or optional.
      • valueThreshold

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> valueThreshold()
        Returns:
        The value to trigger the alarm for.
      • vhostRegex

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> vhostRegex()
        Returns:
        Regex for which vhost to check
      • get

        public static Alarm get​(java.lang.String name,
                                com.pulumi.core.Output<java.lang.String> id,
                                @Nullable
                                AlarmState 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.