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

alicloud.dns.getGroups

Explore with Pulumi AI

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

    This data source provides a list of DNS Domain Groups in an Alibaba Cloud account according to the specified filters.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const groupsDs = alicloud.dns.getGroups({
        nameRegex: "^y[A-Za-z]+",
        outputFile: "groups.txt",
    });
    export const firstGroupName = groupsDs.then(groupsDs => groupsDs.groups?.[0]?.groupName);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    groups_ds = alicloud.dns.get_groups(name_regex="^y[A-Za-z]+",
        output_file="groups.txt")
    pulumi.export("firstGroupName", groups_ds.groups[0].group_name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dns"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		groupsDs, err := dns.GetGroups(ctx, &dns.GetGroupsArgs{
    			NameRegex:  pulumi.StringRef("^y[A-Za-z]+"),
    			OutputFile: pulumi.StringRef("groups.txt"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstGroupName", groupsDs.Groups[0].GroupName)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var groupsDs = AliCloud.Dns.GetGroups.Invoke(new()
        {
            NameRegex = "^y[A-Za-z]+",
            OutputFile = "groups.txt",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstGroupName"] = groupsDs.Apply(getGroupsResult => getGroupsResult.Groups[0]?.GroupName),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.dns.DnsFunctions;
    import com.pulumi.alicloud.dns.inputs.GetGroupsArgs;
    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 groupsDs = DnsFunctions.getGroups(GetGroupsArgs.builder()
                .nameRegex("^y[A-Za-z]+")
                .outputFile("groups.txt")
                .build());
    
            ctx.export("firstGroupName", groupsDs.applyValue(getGroupsResult -> getGroupsResult.groups()[0].groupName()));
        }
    }
    
    variables:
      groupsDs:
        fn::invoke:
          Function: alicloud:dns:getGroups
          Arguments:
            nameRegex: ^y[A-Za-z]+
            outputFile: groups.txt
    outputs:
      firstGroupName: ${groupsDs.groups[0].groupName}
    

    Using getGroups

    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 getGroups(args: GetGroupsArgs, opts?: InvokeOptions): Promise<GetGroupsResult>
    function getGroupsOutput(args: GetGroupsOutputArgs, opts?: InvokeOptions): Output<GetGroupsResult>
    def get_groups(ids: Optional[Sequence[str]] = None,
                   name_regex: Optional[str] = None,
                   output_file: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetGroupsResult
    def get_groups_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[GetGroupsResult]
    func GetGroups(ctx *Context, args *GetGroupsArgs, opts ...InvokeOption) (*GetGroupsResult, error)
    func GetGroupsOutput(ctx *Context, args *GetGroupsOutputArgs, opts ...InvokeOption) GetGroupsResultOutput

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

    public static class GetGroups 
    {
        public static Task<GetGroupsResult> InvokeAsync(GetGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetGroupsResult> Invoke(GetGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGroupsResult> getGroups(GetGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:dns/getGroups:getGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

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

    getGroups Result

    The following output properties are available:

    Groups List<Pulumi.AliCloud.Dns.Outputs.GetGroupsGroup>
    A list of groups. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of group IDs.
    Names List<string>
    A list of group names.
    NameRegex string
    OutputFile string
    Groups []GetGroupsGroup
    A list of groups. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of group IDs.
    Names []string
    A list of group names.
    NameRegex string
    OutputFile string
    groups List<GetGroupsGroup>
    A list of groups. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of group IDs.
    names List<String>
    A list of group names.
    nameRegex String
    outputFile String
    groups GetGroupsGroup[]
    A list of groups. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of group IDs.
    names string[]
    A list of group names.
    nameRegex string
    outputFile string
    groups Sequence[GetGroupsGroup]
    A list of groups. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of group IDs.
    names Sequence[str]
    A list of group names.
    name_regex str
    output_file str
    groups List<Property Map>
    A list of groups. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of group IDs.
    names List<String>
    A list of group names.
    nameRegex String
    outputFile String

    Supporting Types

    GetGroupsGroup

    GroupId string
    Id of the group.
    GroupName string
    Name of the group.
    GroupId string
    Id of the group.
    GroupName string
    Name of the group.
    groupId String
    Id of the group.
    groupName String
    Name of the group.
    groupId string
    Id of the group.
    groupName string
    Name of the group.
    group_id str
    Id of the group.
    group_name str
    Name of the group.
    groupId String
    Id of the group.
    groupName String
    Name of the 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.66.0 published on Friday, Nov 15, 2024 by Pulumi