1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dfs
  5. getAccessGroups
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.dfs.getAccessGroups

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides the Apsara File Storage for HDFS Access Groups of the current Alibaba Cloud user.

    NOTE: Available in v1.133.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.dfs.getAccessGroups({
        ids: ["example_id"],
    });
    export const dfsAccessGroupId1 = ids.then(ids => ids.groups?.[0]?.id);
    const nameRegex = alicloud.dfs.getAccessGroups({
        nameRegex: "^my-AccessGroup",
    });
    export const dfsAccessGroupId2 = nameRegex.then(nameRegex => nameRegex.groups?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.dfs.get_access_groups(ids=["example_id"])
    pulumi.export("dfsAccessGroupId1", ids.groups[0].id)
    name_regex = alicloud.dfs.get_access_groups(name_regex="^my-AccessGroup")
    pulumi.export("dfsAccessGroupId2", name_regex.groups[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dfs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := dfs.GetAccessGroups(ctx, &dfs.GetAccessGroupsArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("dfsAccessGroupId1", ids.Groups[0].Id)
    		nameRegex, err := dfs.GetAccessGroups(ctx, &dfs.GetAccessGroupsArgs{
    			NameRegex: pulumi.StringRef("^my-AccessGroup"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("dfsAccessGroupId2", nameRegex.Groups[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Dfs.GetAccessGroups.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var nameRegex = AliCloud.Dfs.GetAccessGroups.Invoke(new()
        {
            NameRegex = "^my-AccessGroup",
        });
    
        return new Dictionary<string, object?>
        {
            ["dfsAccessGroupId1"] = ids.Apply(getAccessGroupsResult => getAccessGroupsResult.Groups[0]?.Id),
            ["dfsAccessGroupId2"] = nameRegex.Apply(getAccessGroupsResult => getAccessGroupsResult.Groups[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.dfs.DfsFunctions;
    import com.pulumi.alicloud.dfs.inputs.GetAccessGroupsArgs;
    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 = DfsFunctions.getAccessGroups(GetAccessGroupsArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("dfsAccessGroupId1", ids.applyValue(getAccessGroupsResult -> getAccessGroupsResult.groups()[0].id()));
            final var nameRegex = DfsFunctions.getAccessGroups(GetAccessGroupsArgs.builder()
                .nameRegex("^my-AccessGroup")
                .build());
    
            ctx.export("dfsAccessGroupId2", nameRegex.applyValue(getAccessGroupsResult -> getAccessGroupsResult.groups()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:dfs:getAccessGroups
          Arguments:
            ids:
              - example_id
      nameRegex:
        fn::invoke:
          Function: alicloud:dfs:getAccessGroups
          Arguments:
            nameRegex: ^my-AccessGroup
    outputs:
      dfsAccessGroupId1: ${ids.groups[0].id}
      dfsAccessGroupId2: ${nameRegex.groups[0].id}
    

    Using getAccessGroups

    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 getAccessGroups(args: GetAccessGroupsArgs, opts?: InvokeOptions): Promise<GetAccessGroupsResult>
    function getAccessGroupsOutput(args: GetAccessGroupsOutputArgs, opts?: InvokeOptions): Output<GetAccessGroupsResult>
    def get_access_groups(ids: Optional[Sequence[str]] = None,
                          limit: Optional[int] = None,
                          name_regex: Optional[str] = None,
                          order_by: Optional[str] = None,
                          order_type: Optional[str] = None,
                          output_file: Optional[str] = None,
                          start_offset: Optional[int] = None,
                          opts: Optional[InvokeOptions] = None) -> GetAccessGroupsResult
    def get_access_groups_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          limit: Optional[pulumi.Input[int]] = None,
                          name_regex: Optional[pulumi.Input[str]] = None,
                          order_by: Optional[pulumi.Input[str]] = None,
                          order_type: Optional[pulumi.Input[str]] = None,
                          output_file: Optional[pulumi.Input[str]] = None,
                          start_offset: Optional[pulumi.Input[int]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetAccessGroupsResult]
    func GetAccessGroups(ctx *Context, args *GetAccessGroupsArgs, opts ...InvokeOption) (*GetAccessGroupsResult, error)
    func GetAccessGroupsOutput(ctx *Context, args *GetAccessGroupsOutputArgs, opts ...InvokeOption) GetAccessGroupsResultOutput

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

    public static class GetAccessGroups 
    {
        public static Task<GetAccessGroupsResult> InvokeAsync(GetAccessGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetAccessGroupsResult> Invoke(GetAccessGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccessGroupsResult> getAccessGroups(GetAccessGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:dfs/getAccessGroups:getAccessGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Access Group IDs.
    Limit int
    NameRegex string
    A regex string to filter results by Access Group name.
    OrderBy string
    OrderType string
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    StartOffset int
    Ids []string
    A list of Access Group IDs.
    Limit int
    NameRegex string
    A regex string to filter results by Access Group name.
    OrderBy string
    OrderType string
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    StartOffset int
    ids List<String>
    A list of Access Group IDs.
    limit Integer
    nameRegex String
    A regex string to filter results by Access Group name.
    orderBy String
    orderType String
    outputFile String
    File name where to save data source results (after running pulumi preview).
    startOffset Integer
    ids string[]
    A list of Access Group IDs.
    limit number
    nameRegex string
    A regex string to filter results by Access Group name.
    orderBy string
    orderType string
    outputFile string
    File name where to save data source results (after running pulumi preview).
    startOffset number
    ids Sequence[str]
    A list of Access Group IDs.
    limit int
    name_regex str
    A regex string to filter results by Access Group name.
    order_by str
    order_type str
    output_file str
    File name where to save data source results (after running pulumi preview).
    start_offset int
    ids List<String>
    A list of Access Group IDs.
    limit Number
    nameRegex String
    A regex string to filter results by Access Group name.
    orderBy String
    orderType String
    outputFile String
    File name where to save data source results (after running pulumi preview).
    startOffset Number

    getAccessGroups Result

    The following output properties are available:

    Groups List<Pulumi.AliCloud.Dfs.Outputs.GetAccessGroupsGroup>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Limit int
    NameRegex string
    OrderBy string
    OrderType string
    OutputFile string
    StartOffset int
    Groups []GetAccessGroupsGroup
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Limit int
    NameRegex string
    OrderBy string
    OrderType string
    OutputFile string
    StartOffset int
    groups List<GetAccessGroupsGroup>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    limit Integer
    nameRegex String
    orderBy String
    orderType String
    outputFile String
    startOffset Integer
    groups GetAccessGroupsGroup[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    limit number
    nameRegex string
    orderBy string
    orderType string
    outputFile string
    startOffset number
    groups Sequence[GetAccessGroupsGroup]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    limit int
    name_regex str
    order_by str
    order_type str
    output_file str
    start_offset int
    groups List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    limit Number
    nameRegex String
    orderBy String
    orderType String
    outputFile String
    startOffset Number

    Supporting Types

    GetAccessGroupsGroup

    AccessGroupId string
    The length of description does not exceed 100 bytes.
    AccessGroupName string
    The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
    CreateTime string
    The CreateTime of Access Group.
    Description string
    The Description of Access Group. The length Of description does not exceed 100 bytes.
    Id string
    The ID of the Access Group.
    MountPointCount int
    The Number of attached mountpoint.
    NetworkType string
    The NetworkType of Access Group. Valid values: VPC.
    RuleCount int
    The Number of access rule.
    AccessGroupId string
    The length of description does not exceed 100 bytes.
    AccessGroupName string
    The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
    CreateTime string
    The CreateTime of Access Group.
    Description string
    The Description of Access Group. The length Of description does not exceed 100 bytes.
    Id string
    The ID of the Access Group.
    MountPointCount int
    The Number of attached mountpoint.
    NetworkType string
    The NetworkType of Access Group. Valid values: VPC.
    RuleCount int
    The Number of access rule.
    accessGroupId String
    The length of description does not exceed 100 bytes.
    accessGroupName String
    The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
    createTime String
    The CreateTime of Access Group.
    description String
    The Description of Access Group. The length Of description does not exceed 100 bytes.
    id String
    The ID of the Access Group.
    mountPointCount Integer
    The Number of attached mountpoint.
    networkType String
    The NetworkType of Access Group. Valid values: VPC.
    ruleCount Integer
    The Number of access rule.
    accessGroupId string
    The length of description does not exceed 100 bytes.
    accessGroupName string
    The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
    createTime string
    The CreateTime of Access Group.
    description string
    The Description of Access Group. The length Of description does not exceed 100 bytes.
    id string
    The ID of the Access Group.
    mountPointCount number
    The Number of attached mountpoint.
    networkType string
    The NetworkType of Access Group. Valid values: VPC.
    ruleCount number
    The Number of access rule.
    access_group_id str
    The length of description does not exceed 100 bytes.
    access_group_name str
    The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
    create_time str
    The CreateTime of Access Group.
    description str
    The Description of Access Group. The length Of description does not exceed 100 bytes.
    id str
    The ID of the Access Group.
    mount_point_count int
    The Number of attached mountpoint.
    network_type str
    The NetworkType of Access Group. Valid values: VPC.
    rule_count int
    The Number of access rule.
    accessGroupId String
    The length of description does not exceed 100 bytes.
    accessGroupName String
    The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
    createTime String
    The CreateTime of Access Group.
    description String
    The Description of Access Group. The length Of description does not exceed 100 bytes.
    id String
    The ID of the Access Group.
    mountPointCount Number
    The Number of attached mountpoint.
    networkType String
    The NetworkType of Access Group. Valid values: VPC.
    ruleCount Number
    The Number of access rule.

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi