1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. arms
  5. getAlertContacts
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

alicloud.arms.getAlertContacts

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 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);
    
    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)
    
    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, nil, 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
    	})
    }
    
    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),
        };
    });
    
    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()));
        }
    }
    
    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}
    

    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>
    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]
    func GetAlertContacts(ctx *Context, args *GetAlertContactsArgs, opts ...InvokeOption) (*GetAlertContactsResult, error)
    func GetAlertContactsOutput(ctx *Context, args *GetAlertContactsOutputArgs, opts ...InvokeOption) GetAlertContactsResultOutput

    > 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)
    }
    public static CompletableFuture<GetAlertContactsResult> getAlertContacts(GetAlertContactsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:arms/getAlertContacts:getAlertContacts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AlertContactName string
    The name of the alert contact.
    Email string
    The email address of the alert contact.
    Ids List<string>
    A list of Alert Contact IDs.
    NameRegex 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 string
    The mobile number of the alert contact.
    AlertContactName string
    The name of the alert contact.
    Email string
    The email address of the alert contact.
    Ids []string
    A list of Alert Contact IDs.
    NameRegex 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 string
    The mobile number of the alert contact.
    alertContactName String
    The name of the alert contact.
    email String
    The email address of the alert contact.
    ids List<String>
    A list of Alert Contact IDs.
    nameRegex 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 String
    The mobile number of the alert contact.
    alertContactName string
    The name of the alert contact.
    email string
    The email address of the alert contact.
    ids string[]
    A list of Alert Contact IDs.
    nameRegex 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 string
    The mobile number of the alert contact.
    alert_contact_name str
    The name of the alert contact.
    email str
    The email address of the alert contact.
    ids Sequence[str]
    A list of Alert Contact IDs.
    name_regex 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 str
    The mobile number of the alert contact.
    alertContactName String
    The name of the alert contact.
    email String
    The email address of the alert contact.
    ids List<String>
    A list of Alert Contact IDs.
    nameRegex 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 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 string
    Contact ID.
    AlertContactName string
    The name of the alert contact.
    CreateTime string
    The Creation Time Timestamp.
    DingRobotWebhookUrl string
    The webhook URL of the DingTalk chatbot.
    Email string
    The email address of the alert contact.
    Id string
    The ID of the Alert Contact.
    PhoneNum string
    The mobile number of the alert contact.
    SystemNoc bool
    Specifies whether the alert contact receives system notifications.
    Webhook string
    Webhook Information.
    AlertContactId string
    Contact ID.
    AlertContactName string
    The name of the alert contact.
    CreateTime string
    The Creation Time Timestamp.
    DingRobotWebhookUrl string
    The webhook URL of the DingTalk chatbot.
    Email string
    The email address of the alert contact.
    Id string
    The ID of the Alert Contact.
    PhoneNum string
    The mobile number of the alert contact.
    SystemNoc bool
    Specifies whether the alert contact receives system notifications.
    Webhook string
    Webhook Information.
    alertContactId String
    Contact ID.
    alertContactName String
    The name of the alert contact.
    createTime String
    The Creation Time Timestamp.
    dingRobotWebhookUrl String
    The webhook URL of the DingTalk chatbot.
    email String
    The email address of the alert contact.
    id String
    The ID of the Alert Contact.
    phoneNum String
    The mobile number of the alert contact.
    systemNoc Boolean
    Specifies whether the alert contact receives system notifications.
    webhook String
    Webhook Information.
    alertContactId string
    Contact ID.
    alertContactName string
    The name of the alert contact.
    createTime string
    The Creation Time Timestamp.
    dingRobotWebhookUrl string
    The webhook URL of the DingTalk chatbot.
    email string
    The email address of the alert contact.
    id string
    The ID of the Alert Contact.
    phoneNum string
    The mobile number of the alert contact.
    systemNoc boolean
    Specifies whether the alert contact receives system notifications.
    webhook string
    Webhook Information.
    alert_contact_id str
    Contact ID.
    alert_contact_name str
    The name of the alert contact.
    create_time str
    The Creation Time Timestamp.
    ding_robot_webhook_url str
    The webhook URL of the DingTalk chatbot.
    email str
    The email address of the alert contact.
    id str
    The ID of the Alert Contact.
    phone_num str
    The mobile number of the alert contact.
    system_noc bool
    Specifies whether the alert contact receives system notifications.
    webhook str
    Webhook Information.
    alertContactId String
    Contact ID.
    alertContactName String
    The name of the alert contact.
    createTime String
    The Creation Time Timestamp.
    dingRobotWebhookUrl String
    The webhook URL of the DingTalk chatbot.
    email String
    The email address of the alert contact.
    id String
    The ID of the Alert Contact.
    phoneNum String
    The mobile number of the alert contact.
    systemNoc Boolean
    Specifies whether the alert contact receives system notifications.
    webhook 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.
    alicloud logo
    Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi