1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. getMscSubContacts
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.getMscSubContacts

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Message Center Contacts of the current Alibaba Cloud user.

    NOTE: Available in v1.132.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.getMscSubContacts({});
    export const mscSubContactId1 = ids.then(ids => ids.contacts?.[0]?.id);
    const nameRegex = alicloud.getMscSubContacts({
        nameRegex: "^my-Contact",
    });
    export const mscSubContactId2 = nameRegex.then(nameRegex => nameRegex.contacts?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.get_msc_sub_contacts()
    pulumi.export("mscSubContactId1", ids.contacts[0].id)
    name_regex = alicloud.get_msc_sub_contacts(name_regex="^my-Contact")
    pulumi.export("mscSubContactId2", name_regex.contacts[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := alicloud.GetMscSubContacts(ctx, &alicloud.GetMscSubContactsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("mscSubContactId1", ids.Contacts[0].Id)
    		nameRegex, err := alicloud.GetMscSubContacts(ctx, &alicloud.GetMscSubContactsArgs{
    			NameRegex: pulumi.StringRef("^my-Contact"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("mscSubContactId2", 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.GetMscSubContacts.Invoke();
    
        var nameRegex = AliCloud.GetMscSubContacts.Invoke(new()
        {
            NameRegex = "^my-Contact",
        });
    
        return new Dictionary<string, object?>
        {
            ["mscSubContactId1"] = ids.Apply(getMscSubContactsResult => getMscSubContactsResult.Contacts[0]?.Id),
            ["mscSubContactId2"] = nameRegex.Apply(getMscSubContactsResult => getMscSubContactsResult.Contacts[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetMscSubContactsArgs;
    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 = AlicloudFunctions.getMscSubContacts();
    
            ctx.export("mscSubContactId1", ids.applyValue(getMscSubContactsResult -> getMscSubContactsResult.contacts()[0].id()));
            final var nameRegex = AlicloudFunctions.getMscSubContacts(GetMscSubContactsArgs.builder()
                .nameRegex("^my-Contact")
                .build());
    
            ctx.export("mscSubContactId2", nameRegex.applyValue(getMscSubContactsResult -> getMscSubContactsResult.contacts()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:getMscSubContacts
          Arguments: {}
      nameRegex:
        fn::invoke:
          Function: alicloud:getMscSubContacts
          Arguments:
            nameRegex: ^my-Contact
    outputs:
      mscSubContactId1: ${ids.contacts[0].id}
      mscSubContactId2: ${nameRegex.contacts[0].id}
    

    Using getMscSubContacts

    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 getMscSubContacts(args: GetMscSubContactsArgs, opts?: InvokeOptions): Promise<GetMscSubContactsResult>
    function getMscSubContactsOutput(args: GetMscSubContactsOutputArgs, opts?: InvokeOptions): Output<GetMscSubContactsResult>
    def get_msc_sub_contacts(ids: Optional[Sequence[str]] = None,
                             name_regex: Optional[str] = None,
                             output_file: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetMscSubContactsResult
    def get_msc_sub_contacts_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                             name_regex: Optional[pulumi.Input[str]] = None,
                             output_file: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetMscSubContactsResult]
    func GetMscSubContacts(ctx *Context, args *GetMscSubContactsArgs, opts ...InvokeOption) (*GetMscSubContactsResult, error)
    func GetMscSubContactsOutput(ctx *Context, args *GetMscSubContactsOutputArgs, opts ...InvokeOption) GetMscSubContactsResultOutput

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

    public static class GetMscSubContacts 
    {
        public static Task<GetMscSubContactsResult> InvokeAsync(GetMscSubContactsArgs args, InvokeOptions? opts = null)
        public static Output<GetMscSubContactsResult> Invoke(GetMscSubContactsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMscSubContactsResult> getMscSubContacts(GetMscSubContactsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:index/getMscSubContacts:getMscSubContacts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Contact IDs.
    NameRegex string
    A regex string to filter results by Contact name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of Contact IDs.
    NameRegex string
    A regex string to filter results by Contact name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Contact IDs.
    nameRegex String
    A regex string to filter results by Contact name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of Contact IDs.
    nameRegex string
    A regex string to filter results by Contact name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of Contact IDs.
    name_regex str
    A regex string to filter results by Contact name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Contact IDs.
    nameRegex String
    A regex string to filter results by Contact name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getMscSubContacts Result

    The following output properties are available:

    Contacts List<Pulumi.AliCloud.Outputs.GetMscSubContactsContact>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    NameRegex string
    OutputFile string
    Contacts []GetMscSubContactsContact
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    NameRegex string
    OutputFile string
    contacts List<GetMscSubContactsContact>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    outputFile String
    contacts GetMscSubContactsContact[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    nameRegex string
    outputFile string
    contacts Sequence[GetMscSubContactsContact]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    name_regex str
    output_file str
    contacts List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    outputFile String

    Supporting Types

    GetMscSubContactsContact

    AccountUid string
    UID.
    ContactId string
    The first ID of the resource.
    ContactName string
    The User's Contact Name. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    Email string
    The User's Contact Email Address.
    Id string
    The ID of the Contact.
    IsAccount bool
    Indicates Whether the BGP Group Is the Account Itself.
    IsObsolete bool
    Whether They Have Expired Or Not.
    IsVerifiedEmail bool
    Email Validation for.
    IsVerifiedMobile bool
    If the Phone Verification.
    LastEmailVerificationTimeStamp string
    Last Verification Email Transmission Time.
    LastMobileVerificationTimeStamp string
    The Pieces of Authentication SMS Sending Time.
    Mobile string
    The User's Telephone.
    Position string
    The User's Position. Valid values: CEO, Technical Director, Maintenance Director, Project Director,Finance Director and Other.
    AccountUid string
    UID.
    ContactId string
    The first ID of the resource.
    ContactName string
    The User's Contact Name. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    Email string
    The User's Contact Email Address.
    Id string
    The ID of the Contact.
    IsAccount bool
    Indicates Whether the BGP Group Is the Account Itself.
    IsObsolete bool
    Whether They Have Expired Or Not.
    IsVerifiedEmail bool
    Email Validation for.
    IsVerifiedMobile bool
    If the Phone Verification.
    LastEmailVerificationTimeStamp string
    Last Verification Email Transmission Time.
    LastMobileVerificationTimeStamp string
    The Pieces of Authentication SMS Sending Time.
    Mobile string
    The User's Telephone.
    Position string
    The User's Position. Valid values: CEO, Technical Director, Maintenance Director, Project Director,Finance Director and Other.
    accountUid String
    UID.
    contactId String
    The first ID of the resource.
    contactName String
    The User's Contact Name. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    email String
    The User's Contact Email Address.
    id String
    The ID of the Contact.
    isAccount Boolean
    Indicates Whether the BGP Group Is the Account Itself.
    isObsolete Boolean
    Whether They Have Expired Or Not.
    isVerifiedEmail Boolean
    Email Validation for.
    isVerifiedMobile Boolean
    If the Phone Verification.
    lastEmailVerificationTimeStamp String
    Last Verification Email Transmission Time.
    lastMobileVerificationTimeStamp String
    The Pieces of Authentication SMS Sending Time.
    mobile String
    The User's Telephone.
    position String
    The User's Position. Valid values: CEO, Technical Director, Maintenance Director, Project Director,Finance Director and Other.
    accountUid string
    UID.
    contactId string
    The first ID of the resource.
    contactName string
    The User's Contact Name. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    email string
    The User's Contact Email Address.
    id string
    The ID of the Contact.
    isAccount boolean
    Indicates Whether the BGP Group Is the Account Itself.
    isObsolete boolean
    Whether They Have Expired Or Not.
    isVerifiedEmail boolean
    Email Validation for.
    isVerifiedMobile boolean
    If the Phone Verification.
    lastEmailVerificationTimeStamp string
    Last Verification Email Transmission Time.
    lastMobileVerificationTimeStamp string
    The Pieces of Authentication SMS Sending Time.
    mobile string
    The User's Telephone.
    position string
    The User's Position. Valid values: CEO, Technical Director, Maintenance Director, Project Director,Finance Director and Other.
    account_uid str
    UID.
    contact_id str
    The first ID of the resource.
    contact_name str
    The User's Contact Name. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    email str
    The User's Contact Email Address.
    id str
    The ID of the Contact.
    is_account bool
    Indicates Whether the BGP Group Is the Account Itself.
    is_obsolete bool
    Whether They Have Expired Or Not.
    is_verified_email bool
    Email Validation for.
    is_verified_mobile bool
    If the Phone Verification.
    last_email_verification_time_stamp str
    Last Verification Email Transmission Time.
    last_mobile_verification_time_stamp str
    The Pieces of Authentication SMS Sending Time.
    mobile str
    The User's Telephone.
    position str
    The User's Position. Valid values: CEO, Technical Director, Maintenance Director, Project Director,Finance Director and Other.
    accountUid String
    UID.
    contactId String
    The first ID of the resource.
    contactName String
    The User's Contact Name. Note: The name must be 2 to 12 characters in length, and can contain uppercase and lowercase letters.
    email String
    The User's Contact Email Address.
    id String
    The ID of the Contact.
    isAccount Boolean
    Indicates Whether the BGP Group Is the Account Itself.
    isObsolete Boolean
    Whether They Have Expired Or Not.
    isVerifiedEmail Boolean
    Email Validation for.
    isVerifiedMobile Boolean
    If the Phone Verification.
    lastEmailVerificationTimeStamp String
    Last Verification Email Transmission Time.
    lastMobileVerificationTimeStamp String
    The Pieces of Authentication SMS Sending Time.
    mobile String
    The User's Telephone.
    position String
    The User's Position. Valid values: CEO, Technical Director, Maintenance Director, Project Director,Finance Director and Other.

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi