1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dfs
  5. getAccessRules
Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi

alicloud.dfs.getAccessRules

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 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);
    
    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)
    
    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
    	})
    }
    
    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),
        };
    });
    
    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()));
        }
    }
    
    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}
    

    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>
    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]
    func GetAccessRules(ctx *Context, args *GetAccessRulesArgs, opts ...InvokeOption) (*GetAccessRulesResult, error)
    func GetAccessRulesOutput(ctx *Context, args *GetAccessRulesOutputArgs, opts ...InvokeOption) GetAccessRulesResultOutput

    > 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)
    }
    public static CompletableFuture<GetAccessRulesResult> getAccessRules(GetAccessRulesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:dfs/getAccessRules:getAccessRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccessGroupId string
    The resource ID of the Access Group.
    Ids List<string>
    A list of Access Rule IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    AccessGroupId string
    The resource ID of the Access Group.
    Ids []string
    A list of Access Rule IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    accessGroupId String
    The resource ID of the Access Group.
    ids List<String>
    A list of Access Rule IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    accessGroupId string
    The resource ID of the Access Group.
    ids string[]
    A list of Access Rule IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    access_group_id str
    The resource ID of the Access Group.
    ids Sequence[str]
    A list of Access Rule IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    accessGroupId String
    The resource ID of the Access Group.
    ids 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 string
    The resource ID of the Access Group.
    AccessRuleId string
    The ID of the Access Rule.
    CreateTime string
    The created time of the Access Rule.
    Description string
    The description of the Access Rule.
    Id string
    The resource ID of Access Rule.
    NetworkSegment string
    The NetworkSegment of the Access Rule.
    Priority int
    The priority of the Access Rule.
    RwAccessType string
    RWAccessType of the Access Rule. Valid values: RDONLY, RDWR.
    AccessGroupId string
    The resource ID of the Access Group.
    AccessRuleId string
    The ID of the Access Rule.
    CreateTime string
    The created time of the Access Rule.
    Description string
    The description of the Access Rule.
    Id string
    The resource ID of Access Rule.
    NetworkSegment string
    The NetworkSegment of the Access Rule.
    Priority int
    The priority of the Access Rule.
    RwAccessType string
    RWAccessType of the Access Rule. Valid values: RDONLY, RDWR.
    accessGroupId String
    The resource ID of the Access Group.
    accessRuleId String
    The ID of the Access Rule.
    createTime String
    The created time of the Access Rule.
    description String
    The description of the Access Rule.
    id String
    The resource ID of Access Rule.
    networkSegment String
    The NetworkSegment of the Access Rule.
    priority Integer
    The priority of the Access Rule.
    rwAccessType String
    RWAccessType of the Access Rule. Valid values: RDONLY, RDWR.
    accessGroupId string
    The resource ID of the Access Group.
    accessRuleId string
    The ID of the Access Rule.
    createTime string
    The created time of the Access Rule.
    description string
    The description of the Access Rule.
    id string
    The resource ID of Access Rule.
    networkSegment string
    The NetworkSegment of the Access Rule.
    priority number
    The priority of the Access Rule.
    rwAccessType string
    RWAccessType of the Access Rule. Valid values: RDONLY, RDWR.
    access_group_id str
    The resource ID of the Access Group.
    access_rule_id str
    The ID of the Access Rule.
    create_time str
    The created time of the Access Rule.
    description str
    The description of the Access Rule.
    id str
    The resource ID of Access Rule.
    network_segment str
    The NetworkSegment of the Access Rule.
    priority int
    The priority of the Access Rule.
    rw_access_type str
    RWAccessType of the Access Rule. Valid values: RDONLY, RDWR.
    accessGroupId String
    The resource ID of the Access Group.
    accessRuleId String
    The ID of the Access Rule.
    createTime String
    The created time of the Access Rule.
    description String
    The description of the Access Rule.
    id String
    The resource ID of Access Rule.
    networkSegment String
    The NetworkSegment of the Access Rule.
    priority Number
    The priority of the Access Rule.
    rwAccessType 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.
    alicloud logo
    Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi