1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. dfs
  5. getAccessGroups
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.dfs.getAccessGroups

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 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);
Copy
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)
Copy
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
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
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}
Copy

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>
Copy
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]
Copy
func GetAccessGroups(ctx *Context, args *GetAccessGroupsArgs, opts ...InvokeOption) (*GetAccessGroupsResult, error)
func GetAccessGroupsOutput(ctx *Context, args *GetAccessGroupsOutputArgs, opts ...InvokeOption) GetAccessGroupsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetAccessGroupsResult> getAccessGroups(GetAccessGroupsArgs args, InvokeOptions options)
public static Output<GetAccessGroupsResult> getAccessGroups(GetAccessGroupsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:dfs/getAccessGroups:getAccessGroups
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of Access Group IDs.
Limit Changes to this property will trigger replacement. int
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Access Group name.
OrderBy Changes to this property will trigger replacement. string
OrderType Changes to this property will trigger replacement. string
OutputFile string
File name where to save data source results (after running pulumi preview).
StartOffset Changes to this property will trigger replacement. int
Ids Changes to this property will trigger replacement. []string
A list of Access Group IDs.
Limit Changes to this property will trigger replacement. int
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Access Group name.
OrderBy Changes to this property will trigger replacement. string
OrderType Changes to this property will trigger replacement. string
OutputFile string
File name where to save data source results (after running pulumi preview).
StartOffset Changes to this property will trigger replacement. int
ids Changes to this property will trigger replacement. List<String>
A list of Access Group IDs.
limit Changes to this property will trigger replacement. Integer
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Access Group name.
orderBy Changes to this property will trigger replacement. String
orderType Changes to this property will trigger replacement. String
outputFile String
File name where to save data source results (after running pulumi preview).
startOffset Changes to this property will trigger replacement. Integer
ids Changes to this property will trigger replacement. string[]
A list of Access Group IDs.
limit Changes to this property will trigger replacement. number
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Access Group name.
orderBy Changes to this property will trigger replacement. string
orderType Changes to this property will trigger replacement. string
outputFile string
File name where to save data source results (after running pulumi preview).
startOffset Changes to this property will trigger replacement. number
ids Changes to this property will trigger replacement. Sequence[str]
A list of Access Group IDs.
limit Changes to this property will trigger replacement. int
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Access Group name.
order_by Changes to this property will trigger replacement. str
order_type Changes to this property will trigger replacement. str
output_file str
File name where to save data source results (after running pulumi preview).
start_offset Changes to this property will trigger replacement. int
ids Changes to this property will trigger replacement. List<String>
A list of Access Group IDs.
limit Changes to this property will trigger replacement. Number
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Access Group name.
orderBy Changes to this property will trigger replacement. String
orderType Changes to this property will trigger replacement. String
outputFile String
File name where to save data source results (after running pulumi preview).
startOffset Changes to this property will trigger replacement. 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 This property is required. string
The length of description does not exceed 100 bytes.
AccessGroupName This property is required. string
The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
CreateTime This property is required. string
The CreateTime of Access Group.
Description This property is required. string
The Description of Access Group. The length Of description does not exceed 100 bytes.
Id This property is required. string
The ID of the Access Group.
MountPointCount This property is required. int
The Number of attached mountpoint.
NetworkType This property is required. string
The NetworkType of Access Group. Valid values: VPC.
RuleCount This property is required. int
The Number of access rule.
AccessGroupId This property is required. string
The length of description does not exceed 100 bytes.
AccessGroupName This property is required. string
The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
CreateTime This property is required. string
The CreateTime of Access Group.
Description This property is required. string
The Description of Access Group. The length Of description does not exceed 100 bytes.
Id This property is required. string
The ID of the Access Group.
MountPointCount This property is required. int
The Number of attached mountpoint.
NetworkType This property is required. string
The NetworkType of Access Group. Valid values: VPC.
RuleCount This property is required. int
The Number of access rule.
accessGroupId This property is required. String
The length of description does not exceed 100 bytes.
accessGroupName This property is required. String
The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
createTime This property is required. String
The CreateTime of Access Group.
description This property is required. String
The Description of Access Group. The length Of description does not exceed 100 bytes.
id This property is required. String
The ID of the Access Group.
mountPointCount This property is required. Integer
The Number of attached mountpoint.
networkType This property is required. String
The NetworkType of Access Group. Valid values: VPC.
ruleCount This property is required. Integer
The Number of access rule.
accessGroupId This property is required. string
The length of description does not exceed 100 bytes.
accessGroupName This property is required. string
The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
createTime This property is required. string
The CreateTime of Access Group.
description This property is required. string
The Description of Access Group. The length Of description does not exceed 100 bytes.
id This property is required. string
The ID of the Access Group.
mountPointCount This property is required. number
The Number of attached mountpoint.
networkType This property is required. string
The NetworkType of Access Group. Valid values: VPC.
ruleCount This property is required. number
The Number of access rule.
access_group_id This property is required. str
The length of description does not exceed 100 bytes.
access_group_name This property is required. str
The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
create_time This property is required. str
The CreateTime of Access Group.
description This property is required. str
The Description of Access Group. The length Of description does not exceed 100 bytes.
id This property is required. str
The ID of the Access Group.
mount_point_count This property is required. int
The Number of attached mountpoint.
network_type This property is required. str
The NetworkType of Access Group. Valid values: VPC.
rule_count This property is required. int
The Number of access rule.
accessGroupId This property is required. String
The length of description does not exceed 100 bytes.
accessGroupName This property is required. String
The Name of Access Group. The length Of access_group_name does not exceed 100 bytes.
createTime This property is required. String
The CreateTime of Access Group.
description This property is required. String
The Description of Access Group. The length Of description does not exceed 100 bytes.
id This property is required. String
The ID of the Access Group.
mountPointCount This property is required. Number
The Number of attached mountpoint.
networkType This property is required. String
The NetworkType of Access Group. Valid values: VPC.
ruleCount This property is required. 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.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi