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.

Attributes reference

All attributes reference are computed

  • id - The identifier for this resource.
  • enabled - Enable/disable status of the alarm.
  • value_threshold - The value threshold that triggers the alarm.
  • time_threshold - The time interval (in seconds) the value_threshold should be active before trigger an alarm.
  • queue_regex - Regular expression for which queue to check.
  • vhost_regex - Regular expression for which vhost to check
  • recipients - Identifier for recipient to be notified.
  • message_type - 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/v3/go/cloudamqp"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "cpu"
		_, err := cloudamqp.LookupAlarm(ctx, &GetAlarmArgs{
			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

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

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

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

public static class GetAlarm 
{
    public static Task<GetAlarmResult> InvokeAsync(GetAlarmArgs args, InvokeOptions? opts = null)
    public static Output<GetAlarmResult> Invoke(GetAlarmInvokeArgs 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
instance_id int
alarm_id int
type str

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.