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

alicloud.dfs.getAccessRules

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

This data source provides the Dfs Access Rules of the current Alibaba Cloud user.

NOTE: Available in v1.140.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.dfs.getAccessRules({
    accessGroupId: "example_value",
    ids: [
        "example_value-1",
        "example_value-2",
    ],
});
export const dfsAccessRuleId1 = ids.then(ids => ids.rules?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.dfs.get_access_rules(access_group_id="example_value",
    ids=[
        "example_value-1",
        "example_value-2",
    ])
pulumi.export("dfsAccessRuleId1", ids.rules[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.GetAccessRules(ctx, &dfs.GetAccessRulesArgs{
			AccessGroupId: "example_value",
			Ids: []string{
				"example_value-1",
				"example_value-2",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("dfsAccessRuleId1", ids.Rules[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.GetAccessRules.Invoke(new()
    {
        AccessGroupId = "example_value",
        Ids = new[]
        {
            "example_value-1",
            "example_value-2",
        },
    });

    return new Dictionary<string, object?>
    {
        ["dfsAccessRuleId1"] = ids.Apply(getAccessRulesResult => getAccessRulesResult.Rules[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.GetAccessRulesArgs;
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.getAccessRules(GetAccessRulesArgs.builder()
            .accessGroupId("example_value")
            .ids(            
                "example_value-1",
                "example_value-2")
            .build());

        ctx.export("dfsAccessRuleId1", ids.applyValue(getAccessRulesResult -> getAccessRulesResult.rules()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:dfs:getAccessRules
      arguments:
        accessGroupId: example_value
        ids:
          - example_value-1
          - example_value-2
outputs:
  dfsAccessRuleId1: ${ids.rules[0].id}
Copy

Using getAccessRules

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 getAccessRules(args: GetAccessRulesArgs, opts?: InvokeOptions): Promise<GetAccessRulesResult>
function getAccessRulesOutput(args: GetAccessRulesOutputArgs, opts?: InvokeOptions): Output<GetAccessRulesResult>
Copy
def get_access_rules(access_group_id: Optional[str] = None,
                     ids: Optional[Sequence[str]] = None,
                     output_file: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetAccessRulesResult
def get_access_rules_output(access_group_id: Optional[pulumi.Input[str]] = None,
                     ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetAccessRulesResult]
Copy
func GetAccessRules(ctx *Context, args *GetAccessRulesArgs, opts ...InvokeOption) (*GetAccessRulesResult, error)
func GetAccessRulesOutput(ctx *Context, args *GetAccessRulesOutputArgs, opts ...InvokeOption) GetAccessRulesResultOutput
Copy

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

public static class GetAccessRules 
{
    public static Task<GetAccessRulesResult> InvokeAsync(GetAccessRulesArgs args, InvokeOptions? opts = null)
    public static Output<GetAccessRulesResult> Invoke(GetAccessRulesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAccessRulesResult> getAccessRules(GetAccessRulesArgs args, InvokeOptions options)
public static Output<GetAccessRulesResult> getAccessRules(GetAccessRulesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:dfs/getAccessRules:getAccessRules
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AccessGroupId
This property is required.
Changes to this property will trigger replacement.
string
The resource ID of the Access Group.
Ids Changes to this property will trigger replacement. List<string>
A list of Access Rule IDs.
OutputFile string
File name where to save data source results (after running pulumi preview).
AccessGroupId
This property is required.
Changes to this property will trigger replacement.
string
The resource ID of the Access Group.
Ids Changes to this property will trigger replacement. []string
A list of Access Rule IDs.
OutputFile string
File name where to save data source results (after running pulumi preview).
accessGroupId
This property is required.
Changes to this property will trigger replacement.
String
The resource ID of the Access Group.
ids Changes to this property will trigger replacement. List<String>
A list of Access Rule IDs.
outputFile String
File name where to save data source results (after running pulumi preview).
accessGroupId
This property is required.
Changes to this property will trigger replacement.
string
The resource ID of the Access Group.
ids Changes to this property will trigger replacement. string[]
A list of Access Rule IDs.
outputFile string
File name where to save data source results (after running pulumi preview).
access_group_id
This property is required.
Changes to this property will trigger replacement.
str
The resource ID of the Access Group.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Access Rule IDs.
output_file str
File name where to save data source results (after running pulumi preview).
accessGroupId
This property is required.
Changes to this property will trigger replacement.
String
The resource ID of the Access Group.
ids Changes to this property will trigger replacement. List<String>
A list of Access Rule IDs.
outputFile String
File name where to save data source results (after running pulumi preview).

getAccessRules Result

The following output properties are available:

AccessGroupId string
Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Rules List<Pulumi.AliCloud.Dfs.Outputs.GetAccessRulesRule>
OutputFile string
AccessGroupId string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Rules []GetAccessRulesRule
OutputFile string
accessGroupId String
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
rules List<GetAccessRulesRule>
outputFile String
accessGroupId string
id string
The provider-assigned unique ID for this managed resource.
ids string[]
rules GetAccessRulesRule[]
outputFile string
access_group_id str
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
rules Sequence[GetAccessRulesRule]
output_file str
accessGroupId String
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
rules List<Property Map>
outputFile String

Supporting Types

GetAccessRulesRule

AccessGroupId This property is required. string
The resource ID of the Access Group.
AccessRuleId This property is required. string
The ID of the Access Rule.
CreateTime This property is required. string
The created time of the Access Rule.
Description This property is required. string
The description of the Access Rule.
Id This property is required. string
The resource ID of Access Rule.
NetworkSegment This property is required. string
The NetworkSegment of the Access Rule.
Priority This property is required. int
The priority of the Access Rule.
RwAccessType This property is required. string
RWAccessType of the Access Rule. Valid values: RDONLY, RDWR.
AccessGroupId This property is required. string
The resource ID of the Access Group.
AccessRuleId This property is required. string
The ID of the Access Rule.
CreateTime This property is required. string
The created time of the Access Rule.
Description This property is required. string
The description of the Access Rule.
Id This property is required. string
The resource ID of Access Rule.
NetworkSegment This property is required. string
The NetworkSegment of the Access Rule.
Priority This property is required. int
The priority of the Access Rule.
RwAccessType This property is required. string
RWAccessType of the Access Rule. Valid values: RDONLY, RDWR.
accessGroupId This property is required. String
The resource ID of the Access Group.
accessRuleId This property is required. String
The ID of the Access Rule.
createTime This property is required. String
The created time of the Access Rule.
description This property is required. String
The description of the Access Rule.
id This property is required. String
The resource ID of Access Rule.
networkSegment This property is required. String
The NetworkSegment of the Access Rule.
priority This property is required. Integer
The priority of the Access Rule.
rwAccessType This property is required. String
RWAccessType of the Access Rule. Valid values: RDONLY, RDWR.
accessGroupId This property is required. string
The resource ID of the Access Group.
accessRuleId This property is required. string
The ID of the Access Rule.
createTime This property is required. string
The created time of the Access Rule.
description This property is required. string
The description of the Access Rule.
id This property is required. string
The resource ID of Access Rule.
networkSegment This property is required. string
The NetworkSegment of the Access Rule.
priority This property is required. number
The priority of the Access Rule.
rwAccessType This property is required. string
RWAccessType of the Access Rule. Valid values: RDONLY, RDWR.
access_group_id This property is required. str
The resource ID of the Access Group.
access_rule_id This property is required. str
The ID of the Access Rule.
create_time This property is required. str
The created time of the Access Rule.
description This property is required. str
The description of the Access Rule.
id This property is required. str
The resource ID of Access Rule.
network_segment This property is required. str
The NetworkSegment of the Access Rule.
priority This property is required. int
The priority of the Access Rule.
rw_access_type This property is required. str
RWAccessType of the Access Rule. Valid values: RDONLY, RDWR.
accessGroupId This property is required. String
The resource ID of the Access Group.
accessRuleId This property is required. String
The ID of the Access Rule.
createTime This property is required. String
The created time of the Access Rule.
description This property is required. String
The description of the Access Rule.
id This property is required. String
The resource ID of Access Rule.
networkSegment This property is required. String
The NetworkSegment of the Access Rule.
priority This property is required. Number
The priority of the Access Rule.
rwAccessType This property is required. String
RWAccessType of the Access Rule. Valid values: RDONLY, RDWR.

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