cloudamqp.getAlarm
Explore with Pulumi AI
Use this data source to retrieve information about default or created alarms. Either use alarm_id
or type
to retrieve the alarm.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudamqp from "@pulumi/cloudamqp";
const defaultCpuAlarm = cloudamqp.getAlarm({
instanceId: instance.id,
type: "cpu",
});
import pulumi
import pulumi_cloudamqp as cloudamqp
default_cpu_alarm = cloudamqp.get_alarm(instance_id=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 {
_, err := cloudamqp.LookupAlarm(ctx, &cloudamqp.LookupAlarmArgs{
InstanceId: instance.Id,
Type: pulumi.StringRef("cpu"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using CloudAmqp = Pulumi.CloudAmqp;
return await Deployment.RunAsync(() =>
{
var defaultCpuAlarm = CloudAmqp.GetAlarm.Invoke(new()
{
InstanceId = instance.Id,
Type = "cpu",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudamqp.CloudamqpFunctions;
import com.pulumi.cloudamqp.inputs.GetAlarmArgs;
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) {
final var defaultCpuAlarm = CloudamqpFunctions.getAlarm(GetAlarmArgs.builder()
.instanceId(instance.id())
.type("cpu")
.build());
}
}
variables:
defaultCpuAlarm:
fn::invoke:
Function: cloudamqp:getAlarm
Arguments:
instanceId: ${instance.id}
type: cpu
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.reminder_interval
- The reminder interval (in seconds) to resend the alarm if not resolved. Set to 0 for no reminders.time_threshold
- The time interval (in seconds) thevalue_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 checkrecipients
- Identifier for recipient to be notified.message_type
- Message type(total, unacked, ready)
used by queue alarm type.
Specific attribute for disk
alarm
value_calculation
- Disk value threshold calculation,(fixed, percentage)
of disk space remaining.
Dependency
This data source depends on CloudAMQP instance identifier, cloudamqp_instance.instance.id
.
Alarm types
cpu, memory, disk, queue, connection, flow, consumer, netsplit, server_unreachable, notice
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,
value_calculation: 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,
value_calculation: 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)
}
public static CompletableFuture<GetAlarmResult> getAlarm(GetAlarmArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: cloudamqp:index/getAlarm:getAlarm
arguments:
# arguments dictionary
The following arguments are supported:
- Instance
Id int - The CloudAMQP instance identifier.
- Alarm
Id int - The alarm identifier. Either use this or
type
to givecloudamqp.Alarm
necessary information to retrieve the alarm. - Type string
- The alarm type. Either use this or
alarm_id
to givecloudamqp.Alarm
necessary information when retrieve the alarm. Supported alarm types - Value
Calculation string
- Instance
Id int - The CloudAMQP instance identifier.
- Alarm
Id int - The alarm identifier. Either use this or
type
to givecloudamqp.Alarm
necessary information to retrieve the alarm. - Type string
- The alarm type. Either use this or
alarm_id
to givecloudamqp.Alarm
necessary information when retrieve the alarm. Supported alarm types - Value
Calculation string
- instance
Id Integer - The CloudAMQP instance identifier.
- alarm
Id Integer - The alarm identifier. Either use this or
type
to givecloudamqp.Alarm
necessary information to retrieve the alarm. - type String
- The alarm type. Either use this or
alarm_id
to givecloudamqp.Alarm
necessary information when retrieve the alarm. Supported alarm types - value
Calculation String
- instance
Id number - The CloudAMQP instance identifier.
- alarm
Id number - The alarm identifier. Either use this or
type
to givecloudamqp.Alarm
necessary information to retrieve the alarm. - type string
- The alarm type. Either use this or
alarm_id
to givecloudamqp.Alarm
necessary information when retrieve the alarm. Supported alarm types - value
Calculation string
- instance_
id int - The CloudAMQP instance identifier.
- alarm_
id int - The alarm identifier. Either use this or
type
to givecloudamqp.Alarm
necessary information to retrieve the alarm. - type str
- The alarm type. Either use this or
alarm_id
to givecloudamqp.Alarm
necessary information when retrieve the alarm. Supported alarm types - value_
calculation str
- instance
Id Number - The CloudAMQP instance identifier.
- alarm
Id Number - The alarm identifier. Either use this or
type
to givecloudamqp.Alarm
necessary information to retrieve the alarm. - type String
- The alarm type. Either use this or
alarm_id
to givecloudamqp.Alarm
necessary information when retrieve the alarm. Supported alarm types - value
Calculation String
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>
- Reminder
Interval int - Time
Threshold int - Value
Threshold int - Vhost
Regex string - Alarm
Id int - Type string
- Value
Calculation 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
- Reminder
Interval int - Time
Threshold int - Value
Threshold int - Vhost
Regex string - Alarm
Id int - Type string
- Value
Calculation string
- enabled Boolean
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Id Integer - message
Type String - queue
Regex String - recipients List<Integer>
- reminder
Interval Integer - time
Threshold Integer - value
Threshold Integer - vhost
Regex String - alarm
Id Integer - type String
- value
Calculation 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[]
- reminder
Interval number - time
Threshold number - value
Threshold number - vhost
Regex string - alarm
Id number - type string
- value
Calculation 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]
- reminder_
interval int - time_
threshold int - value_
threshold int - vhost_
regex str - alarm_
id int - type str
- value_
calculation str
- enabled Boolean
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Id Number - message
Type String - queue
Regex String - recipients List<Number>
- reminder
Interval Number - time
Threshold Number - value
Threshold Number - vhost
Regex String - alarm
Id Number - type String
- value
Calculation String
Package Details
- Repository
- CloudAMQP pulumi/pulumi-cloudamqp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudamqp
Terraform Provider.