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 ortype
to givecloudamqp.Alarm
necessary information to retrieve the alarm.type
- (Optional) The alarm type. Either use this oralarm_id
to givecloudamqp.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) thevalue_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 checkrecipients
- (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:
- Instance
Id int - Alarm
Id int - Type string
- Instance
Id int - Alarm
Id int - Type string
- instance
Id number - alarm
Id 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.
- Instance
Id int - Message
Type string - Queue
Regex string - Recipients List<int>
- Time
Threshold int - Value
Threshold int - Vhost
Regex string - Alarm
Id int - Type string
- Enabled bool
- Id string
The provider-assigned unique ID for this managed resource.
- Instance
Id int - Message
Type string - Queue
Regex string - Recipients []int
- Time
Threshold int - Value
Threshold int - Vhost
Regex string - Alarm
Id int - Type string
- enabled boolean
- id string
The provider-assigned unique ID for this managed resource.
- instance
Id number - message
Type string - queue
Regex string - recipients number[]
- time
Threshold number - value
Threshold number - vhost
Regex string - alarm
Id 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.