Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getAlarm

Use this data source to retrieve information about default or created alarms. Either use alarm_id or type to retrieve the alarm.

Argument reference

  • instance_id - (Required) The CloudAMQP instance identifier.
  • alarm_id - (Optional) The alarm identifier. Either use this or type to give cloudamqp.Alarm necessary information to retrieve the alarm.
  • type - (Optional) The alarm type. Either use this or alarm_id to give cloudamqp.Alarm necessary information when retrieve the alarm.

Attribute reference

  • enabled - (Computed) Enable/disable status of the alarm.
  • value_threshold - (Computed) The value threshold that triggers the alarm.
  • time_threshold - (Computed) The time interval (in seconds) the value_threshold should be active before trigger an alarm.
  • queue_regex - (Computed) Regular expression for which queue to check.
  • vhost_regex - (Computed) Regular expression for which vhost to check
  • recipients - (Computed) Identifier for recipient to be notified.
  • message_type - (Computed) Message type (total, unacked, ready) used by queue alarm type.

Dependency

This data source depends on CloudAMQP instance identifier, cloudamqp_instance.instance.id.

Example Usage

using Pulumi;
using CloudAmqp = Pulumi.CloudAmqp;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultCpuAlarm = Output.Create(CloudAmqp.GetAlarm.InvokeAsync(new CloudAmqp.GetAlarmArgs
        {
            InstanceId = cloudamqp_instance.Instance.Id,
            Type = "cpu",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-cloudamqp/sdk/v2/go/cloudamqp"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "cpu"
        _, err := cloudamqp.LookupAlarm(ctx, &cloudamqp.LookupAlarmArgs{
            InstanceId: cloudamqp_instance.Instance.Id,
            Type:       &opt0,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_cloudamqp as cloudamqp

default_cpu_alarm = cloudamqp.get_alarm(instance_id=cloudamqp_instance["instance"]["id"],
    type="cpu")
import * as pulumi from "@pulumi/pulumi";
import * as cloudamqp from "@pulumi/cloudamqp";

const defaultCpuAlarm = cloudamqp.getAlarm({
    instanceId: cloudamqp_instance.instance.id,
    type: "cpu",
});

Using getAlarm

function getAlarm(args: GetAlarmArgs, opts?: InvokeOptions): Promise<GetAlarmResult>
def get_alarm(alarm_id: Optional[int] = None, instance_id: Optional[int] = None, type: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetAlarmResult
func LookupAlarm(ctx *Context, args *LookupAlarmArgs, opts ...InvokeOption) (*LookupAlarmResult, error)

Note: This function is named LookupAlarm in the Go SDK.

public static class GetAlarm {
    public static Task<GetAlarmResult> InvokeAsync(GetAlarmArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

InstanceId int
AlarmId int
Type string
InstanceId int
AlarmId int
Type string
instanceId number
alarmId number
type string

getAlarm Result

The following output properties are available:

Enabled bool
Id string

The provider-assigned unique ID for this managed resource.

InstanceId int
MessageType string
QueueRegex string
Recipients List<int>
TimeThreshold int
ValueThreshold int
VhostRegex string
AlarmId int
Type string
Enabled bool
Id string

The provider-assigned unique ID for this managed resource.

InstanceId int
MessageType string
QueueRegex string
Recipients []int
TimeThreshold int
ValueThreshold int
VhostRegex string
AlarmId int
Type string
enabled boolean
id string

The provider-assigned unique ID for this managed resource.

instanceId number
messageType string
queueRegex string
recipients number[]
timeThreshold number
valueThreshold number
vhostRegex string
alarmId number
type string
enabled bool
id str

The provider-assigned unique ID for this managed resource.

instance_id int
message_type str
queue_regex str
recipients Sequence[int]
time_threshold int
value_threshold int
vhost_regex str
alarm_id int
type str

Package Details

Repository
https://github.com/pulumi/pulumi-cloudamqp
License
Apache-2.0
Notes
This Pulumi package is based on the cloudamqp Terraform Provider.