1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. arms
  5. getAlertContacts
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.arms.getAlertContacts

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

This data source provides the Arms Alert Contacts of the current Alibaba Cloud user.

NOTE: Available in v1.129.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.arms.getAlertContacts({});
export const armsAlertContactId1 = ids.then(ids => ids.contacts?.[0]?.id);
const nameRegex = alicloud.arms.getAlertContacts({
    nameRegex: "^my-AlertContact",
});
export const armsAlertContactId2 = nameRegex.then(nameRegex => nameRegex.contacts?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.arms.get_alert_contacts()
pulumi.export("armsAlertContactId1", ids.contacts[0].id)
name_regex = alicloud.arms.get_alert_contacts(name_regex="^my-AlertContact")
pulumi.export("armsAlertContactId2", name_regex.contacts[0].id)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/arms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := arms.GetAlertContacts(ctx, &arms.GetAlertContactsArgs{}, nil)
		if err != nil {
			return err
		}
		ctx.Export("armsAlertContactId1", ids.Contacts[0].Id)
		nameRegex, err := arms.GetAlertContacts(ctx, &arms.GetAlertContactsArgs{
			NameRegex: pulumi.StringRef("^my-AlertContact"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("armsAlertContactId2", nameRegex.Contacts[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var ids = AliCloud.Arms.GetAlertContacts.Invoke();

    var nameRegex = AliCloud.Arms.GetAlertContacts.Invoke(new()
    {
        NameRegex = "^my-AlertContact",
    });

    return new Dictionary<string, object?>
    {
        ["armsAlertContactId1"] = ids.Apply(getAlertContactsResult => getAlertContactsResult.Contacts[0]?.Id),
        ["armsAlertContactId2"] = nameRegex.Apply(getAlertContactsResult => getAlertContactsResult.Contacts[0]?.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.arms.ArmsFunctions;
import com.pulumi.alicloud.arms.inputs.GetAlertContactsArgs;
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 ids = ArmsFunctions.getAlertContacts();

        ctx.export("armsAlertContactId1", ids.applyValue(getAlertContactsResult -> getAlertContactsResult.contacts()[0].id()));
        final var nameRegex = ArmsFunctions.getAlertContacts(GetAlertContactsArgs.builder()
            .nameRegex("^my-AlertContact")
            .build());

        ctx.export("armsAlertContactId2", nameRegex.applyValue(getAlertContactsResult -> getAlertContactsResult.contacts()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:arms:getAlertContacts
      arguments: {}
  nameRegex:
    fn::invoke:
      function: alicloud:arms:getAlertContacts
      arguments:
        nameRegex: ^my-AlertContact
outputs:
  armsAlertContactId1: ${ids.contacts[0].id}
  armsAlertContactId2: ${nameRegex.contacts[0].id}
Copy

Using getAlertContacts

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 getAlertContacts(args: GetAlertContactsArgs, opts?: InvokeOptions): Promise<GetAlertContactsResult>
function getAlertContactsOutput(args: GetAlertContactsOutputArgs, opts?: InvokeOptions): Output<GetAlertContactsResult>
Copy
def get_alert_contacts(alert_contact_name: Optional[str] = None,
                       email: Optional[str] = None,
                       ids: Optional[Sequence[str]] = None,
                       name_regex: Optional[str] = None,
                       output_file: Optional[str] = None,
                       phone_num: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetAlertContactsResult
def get_alert_contacts_output(alert_contact_name: Optional[pulumi.Input[str]] = None,
                       email: Optional[pulumi.Input[str]] = None,
                       ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                       name_regex: Optional[pulumi.Input[str]] = None,
                       output_file: Optional[pulumi.Input[str]] = None,
                       phone_num: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetAlertContactsResult]
Copy
func GetAlertContacts(ctx *Context, args *GetAlertContactsArgs, opts ...InvokeOption) (*GetAlertContactsResult, error)
func GetAlertContactsOutput(ctx *Context, args *GetAlertContactsOutputArgs, opts ...InvokeOption) GetAlertContactsResultOutput
Copy

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

public static class GetAlertContacts 
{
    public static Task<GetAlertContactsResult> InvokeAsync(GetAlertContactsArgs args, InvokeOptions? opts = null)
    public static Output<GetAlertContactsResult> Invoke(GetAlertContactsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAlertContactsResult> getAlertContacts(GetAlertContactsArgs args, InvokeOptions options)
public static Output<GetAlertContactsResult> getAlertContacts(GetAlertContactsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:arms/getAlertContacts:getAlertContacts
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AlertContactName Changes to this property will trigger replacement. string
The name of the alert contact.
Email Changes to this property will trigger replacement. string
The email address of the alert contact.
Ids Changes to this property will trigger replacement. List<string>
A list of Alert Contact IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Alert Contact name.
OutputFile string
File name where to save data source results (after running pulumi preview).
PhoneNum Changes to this property will trigger replacement. string
The mobile number of the alert contact.
AlertContactName Changes to this property will trigger replacement. string
The name of the alert contact.
Email Changes to this property will trigger replacement. string
The email address of the alert contact.
Ids Changes to this property will trigger replacement. []string
A list of Alert Contact IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Alert Contact name.
OutputFile string
File name where to save data source results (after running pulumi preview).
PhoneNum Changes to this property will trigger replacement. string
The mobile number of the alert contact.
alertContactName Changes to this property will trigger replacement. String
The name of the alert contact.
email Changes to this property will trigger replacement. String
The email address of the alert contact.
ids Changes to this property will trigger replacement. List<String>
A list of Alert Contact IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Alert Contact name.
outputFile String
File name where to save data source results (after running pulumi preview).
phoneNum Changes to this property will trigger replacement. String
The mobile number of the alert contact.
alertContactName Changes to this property will trigger replacement. string
The name of the alert contact.
email Changes to this property will trigger replacement. string
The email address of the alert contact.
ids Changes to this property will trigger replacement. string[]
A list of Alert Contact IDs.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Alert Contact name.
outputFile string
File name where to save data source results (after running pulumi preview).
phoneNum Changes to this property will trigger replacement. string
The mobile number of the alert contact.
alert_contact_name Changes to this property will trigger replacement. str
The name of the alert contact.
email Changes to this property will trigger replacement. str
The email address of the alert contact.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Alert Contact IDs.
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Alert Contact name.
output_file str
File name where to save data source results (after running pulumi preview).
phone_num Changes to this property will trigger replacement. str
The mobile number of the alert contact.
alertContactName Changes to this property will trigger replacement. String
The name of the alert contact.
email Changes to this property will trigger replacement. String
The email address of the alert contact.
ids Changes to this property will trigger replacement. List<String>
A list of Alert Contact IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Alert Contact name.
outputFile String
File name where to save data source results (after running pulumi preview).
phoneNum Changes to this property will trigger replacement. String
The mobile number of the alert contact.

getAlertContacts Result

The following output properties are available:

Contacts List<Pulumi.AliCloud.Arms.Outputs.GetAlertContactsContact>
Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Names List<string>
AlertContactName string
Email string
NameRegex string
OutputFile string
PhoneNum string
Contacts []GetAlertContactsContact
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
AlertContactName string
Email string
NameRegex string
OutputFile string
PhoneNum string
contacts List<GetAlertContactsContact>
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
alertContactName String
email String
nameRegex String
outputFile String
phoneNum String
contacts GetAlertContactsContact[]
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
alertContactName string
email string
nameRegex string
outputFile string
phoneNum string
contacts Sequence[GetAlertContactsContact]
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
alert_contact_name str
email str
name_regex str
output_file str
phone_num str
contacts List<Property Map>
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
alertContactName String
email String
nameRegex String
outputFile String
phoneNum String

Supporting Types

GetAlertContactsContact

AlertContactId This property is required. string
Contact ID.
AlertContactName This property is required. string
The name of the alert contact.
CreateTime This property is required. string
The Creation Time Timestamp.
DingRobotWebhookUrl This property is required. string
The webhook URL of the DingTalk chatbot.
Email This property is required. string
The email address of the alert contact.
Id This property is required. string
The ID of the Alert Contact.
PhoneNum This property is required. string
The mobile number of the alert contact.
SystemNoc This property is required. bool
Specifies whether the alert contact receives system notifications.
Webhook This property is required. string
Webhook Information.
AlertContactId This property is required. string
Contact ID.
AlertContactName This property is required. string
The name of the alert contact.
CreateTime This property is required. string
The Creation Time Timestamp.
DingRobotWebhookUrl This property is required. string
The webhook URL of the DingTalk chatbot.
Email This property is required. string
The email address of the alert contact.
Id This property is required. string
The ID of the Alert Contact.
PhoneNum This property is required. string
The mobile number of the alert contact.
SystemNoc This property is required. bool
Specifies whether the alert contact receives system notifications.
Webhook This property is required. string
Webhook Information.
alertContactId This property is required. String
Contact ID.
alertContactName This property is required. String
The name of the alert contact.
createTime This property is required. String
The Creation Time Timestamp.
dingRobotWebhookUrl This property is required. String
The webhook URL of the DingTalk chatbot.
email This property is required. String
The email address of the alert contact.
id This property is required. String
The ID of the Alert Contact.
phoneNum This property is required. String
The mobile number of the alert contact.
systemNoc This property is required. Boolean
Specifies whether the alert contact receives system notifications.
webhook This property is required. String
Webhook Information.
alertContactId This property is required. string
Contact ID.
alertContactName This property is required. string
The name of the alert contact.
createTime This property is required. string
The Creation Time Timestamp.
dingRobotWebhookUrl This property is required. string
The webhook URL of the DingTalk chatbot.
email This property is required. string
The email address of the alert contact.
id This property is required. string
The ID of the Alert Contact.
phoneNum This property is required. string
The mobile number of the alert contact.
systemNoc This property is required. boolean
Specifies whether the alert contact receives system notifications.
webhook This property is required. string
Webhook Information.
alert_contact_id This property is required. str
Contact ID.
alert_contact_name This property is required. str
The name of the alert contact.
create_time This property is required. str
The Creation Time Timestamp.
ding_robot_webhook_url This property is required. str
The webhook URL of the DingTalk chatbot.
email This property is required. str
The email address of the alert contact.
id This property is required. str
The ID of the Alert Contact.
phone_num This property is required. str
The mobile number of the alert contact.
system_noc This property is required. bool
Specifies whether the alert contact receives system notifications.
webhook This property is required. str
Webhook Information.
alertContactId This property is required. String
Contact ID.
alertContactName This property is required. String
The name of the alert contact.
createTime This property is required. String
The Creation Time Timestamp.
dingRobotWebhookUrl This property is required. String
The webhook URL of the DingTalk chatbot.
email This property is required. String
The email address of the alert contact.
id This property is required. String
The ID of the Alert Contact.
phoneNum This property is required. String
The mobile number of the alert contact.
systemNoc This property is required. Boolean
Specifies whether the alert contact receives system notifications.
webhook This property is required. String
Webhook Information.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi