1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. arms
  5. getAlertContactGroups
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.arms.getAlertContactGroups

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

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

    NOTE: Available in v1.131.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const nameRegex = alicloud.arms.getAlertContactGroups({
        nameRegex: "^my-AlertContactGroup",
    });
    export const armsAlertContactGroupId = nameRegex.then(nameRegex => nameRegex.groups?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    name_regex = alicloud.arms.get_alert_contact_groups(name_regex="^my-AlertContactGroup")
    pulumi.export("armsAlertContactGroupId", name_regex.groups[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 {
    		nameRegex, err := arms.GetAlertContactGroups(ctx, &arms.GetAlertContactGroupsArgs{
    			NameRegex: pulumi.StringRef("^my-AlertContactGroup"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("armsAlertContactGroupId", nameRegex.Groups[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var nameRegex = AliCloud.Arms.GetAlertContactGroups.Invoke(new()
        {
            NameRegex = "^my-AlertContactGroup",
        });
    
        return new Dictionary<string, object?>
        {
            ["armsAlertContactGroupId"] = nameRegex.Apply(getAlertContactGroupsResult => getAlertContactGroupsResult.Groups[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.GetAlertContactGroupsArgs;
    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 nameRegex = ArmsFunctions.getAlertContactGroups(GetAlertContactGroupsArgs.builder()
                .nameRegex("^my-AlertContactGroup")
                .build());
    
            ctx.export("armsAlertContactGroupId", nameRegex.applyValue(getAlertContactGroupsResult -> getAlertContactGroupsResult.groups()[0].id()));
        }
    }
    
    variables:
      nameRegex:
        fn::invoke:
          Function: alicloud:arms:getAlertContactGroups
          Arguments:
            nameRegex: ^my-AlertContactGroup
    outputs:
      armsAlertContactGroupId: ${nameRegex.groups[0].id}
    

    Using getAlertContactGroups

    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 getAlertContactGroups(args: GetAlertContactGroupsArgs, opts?: InvokeOptions): Promise<GetAlertContactGroupsResult>
    function getAlertContactGroupsOutput(args: GetAlertContactGroupsOutputArgs, opts?: InvokeOptions): Output<GetAlertContactGroupsResult>
    def get_alert_contact_groups(alert_contact_group_name: Optional[str] = None,
                                 contact_id: Optional[str] = None,
                                 contact_name: Optional[str] = None,
                                 ids: Optional[Sequence[str]] = None,
                                 name_regex: Optional[str] = None,
                                 output_file: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetAlertContactGroupsResult
    def get_alert_contact_groups_output(alert_contact_group_name: Optional[pulumi.Input[str]] = None,
                                 contact_id: Optional[pulumi.Input[str]] = None,
                                 contact_name: 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,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetAlertContactGroupsResult]
    func GetAlertContactGroups(ctx *Context, args *GetAlertContactGroupsArgs, opts ...InvokeOption) (*GetAlertContactGroupsResult, error)
    func GetAlertContactGroupsOutput(ctx *Context, args *GetAlertContactGroupsOutputArgs, opts ...InvokeOption) GetAlertContactGroupsResultOutput

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

    public static class GetAlertContactGroups 
    {
        public static Task<GetAlertContactGroupsResult> InvokeAsync(GetAlertContactGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetAlertContactGroupsResult> Invoke(GetAlertContactGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAlertContactGroupsResult> getAlertContactGroups(GetAlertContactGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:arms/getAlertContactGroups:getAlertContactGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AlertContactGroupName string
    The name of the resource.
    ContactId string
    The contact id.
    ContactName string
    The contact name.
    Ids List<string>
    A list of Alert Contact Group IDs.
    NameRegex string
    A regex string to filter results by Alert Contact Group name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    AlertContactGroupName string
    The name of the resource.
    ContactId string
    The contact id.
    ContactName string
    The contact name.
    Ids []string
    A list of Alert Contact Group IDs.
    NameRegex string
    A regex string to filter results by Alert Contact Group name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    alertContactGroupName String
    The name of the resource.
    contactId String
    The contact id.
    contactName String
    The contact name.
    ids List<String>
    A list of Alert Contact Group IDs.
    nameRegex String
    A regex string to filter results by Alert Contact Group name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    alertContactGroupName string
    The name of the resource.
    contactId string
    The contact id.
    contactName string
    The contact name.
    ids string[]
    A list of Alert Contact Group IDs.
    nameRegex string
    A regex string to filter results by Alert Contact Group name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    alert_contact_group_name str
    The name of the resource.
    contact_id str
    The contact id.
    contact_name str
    The contact name.
    ids Sequence[str]
    A list of Alert Contact Group IDs.
    name_regex str
    A regex string to filter results by Alert Contact Group name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    alertContactGroupName String
    The name of the resource.
    contactId String
    The contact id.
    contactName String
    The contact name.
    ids List<String>
    A list of Alert Contact Group IDs.
    nameRegex String
    A regex string to filter results by Alert Contact Group name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getAlertContactGroups Result

    The following output properties are available:

    Groups List<Pulumi.AliCloud.Arms.Outputs.GetAlertContactGroupsGroup>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    AlertContactGroupName string
    ContactId string
    ContactName string
    NameRegex string
    OutputFile string
    Groups []GetAlertContactGroupsGroup
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    AlertContactGroupName string
    ContactId string
    ContactName string
    NameRegex string
    OutputFile string
    groups List<GetAlertContactGroupsGroup>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    alertContactGroupName String
    contactId String
    contactName String
    nameRegex String
    outputFile String
    groups GetAlertContactGroupsGroup[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    alertContactGroupName string
    contactId string
    contactName string
    nameRegex string
    outputFile string
    groups Sequence[GetAlertContactGroupsGroup]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    alert_contact_group_name str
    contact_id str
    contact_name str
    name_regex str
    output_file str
    groups List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    alertContactGroupName String
    contactId String
    contactName String
    nameRegex String
    outputFile String

    Supporting Types

    GetAlertContactGroupsGroup

    AlertContactGroupId string
    The first ID of the resource.
    AlertContactGroupName string
    The name of the resource.
    ContactIds List<string>
    contact ids.
    CreateTime string
    The creation time of the resource.
    Id string
    The ID of the Alert Contact Group.
    AlertContactGroupId string
    The first ID of the resource.
    AlertContactGroupName string
    The name of the resource.
    ContactIds []string
    contact ids.
    CreateTime string
    The creation time of the resource.
    Id string
    The ID of the Alert Contact Group.
    alertContactGroupId String
    The first ID of the resource.
    alertContactGroupName String
    The name of the resource.
    contactIds List<String>
    contact ids.
    createTime String
    The creation time of the resource.
    id String
    The ID of the Alert Contact Group.
    alertContactGroupId string
    The first ID of the resource.
    alertContactGroupName string
    The name of the resource.
    contactIds string[]
    contact ids.
    createTime string
    The creation time of the resource.
    id string
    The ID of the Alert Contact Group.
    alert_contact_group_id str
    The first ID of the resource.
    alert_contact_group_name str
    The name of the resource.
    contact_ids Sequence[str]
    contact ids.
    create_time str
    The creation time of the resource.
    id str
    The ID of the Alert Contact Group.
    alertContactGroupId String
    The first ID of the resource.
    alertContactGroupName String
    The name of the resource.
    contactIds List<String>
    contact ids.
    createTime String
    The creation time of the resource.
    id String
    The ID of the Alert Contact Group.

    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.53.0 published on Wednesday, Apr 17, 2024 by Pulumi