Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.dfs.getAccessRules
Explore with Pulumi AI
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:
- Access
Group stringId - The resource ID of the Access Group.
- Ids List<string>
- A list of Access Rule IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Access
Group stringId - The resource ID of the Access Group.
- Ids []string
- A list of Access Rule IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- access
Group StringId - The resource ID of the Access Group.
- ids List<String>
- A list of Access Rule IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- access
Group stringId - The resource ID of the Access Group.
- ids string[]
- A list of Access Rule IDs.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- access_
group_ strid - 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
).
- access
Group StringId - The resource ID of the Access Group.
- ids List<String>
- A list of Access Rule IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getAccessRules Result
The following output properties are available:
- Access
Group stringId - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Rules
List<Pulumi.
Ali Cloud. Dfs. Outputs. Get Access Rules Rule> - Output
File string
- Access
Group stringId - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Rules
[]Get
Access Rules Rule - Output
File string
- access
Group StringId - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- rules
List<Get
Access Rules Rule> - output
File String
- access
Group stringId - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- rules
Get
Access Rules Rule[] - output
File string
- access_
group_ strid - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- rules
Sequence[Get
Access Rules Rule] - output_
file str
- access
Group StringId - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- rules List<Property Map>
- output
File String
Supporting Types
GetAccessRulesRule
- Access
Group stringId - The resource ID of the Access Group.
- Access
Rule stringId - The ID of the Access Rule.
- Create
Time string - The created time of the Access Rule.
- Description string
- The description of the Access Rule.
- Id string
- The resource ID of Access Rule.
- Network
Segment string - The NetworkSegment of the Access Rule.
- Priority int
- The priority of the Access Rule.
- Rw
Access stringType - RWAccessType of the Access Rule. Valid values:
RDONLY
,RDWR
.
- Access
Group stringId - The resource ID of the Access Group.
- Access
Rule stringId - The ID of the Access Rule.
- Create
Time string - The created time of the Access Rule.
- Description string
- The description of the Access Rule.
- Id string
- The resource ID of Access Rule.
- Network
Segment string - The NetworkSegment of the Access Rule.
- Priority int
- The priority of the Access Rule.
- Rw
Access stringType - RWAccessType of the Access Rule. Valid values:
RDONLY
,RDWR
.
- access
Group StringId - The resource ID of the Access Group.
- access
Rule StringId - The ID of the Access Rule.
- create
Time String - The created time of the Access Rule.
- description String
- The description of the Access Rule.
- id String
- The resource ID of Access Rule.
- network
Segment String - The NetworkSegment of the Access Rule.
- priority Integer
- The priority of the Access Rule.
- rw
Access StringType - RWAccessType of the Access Rule. Valid values:
RDONLY
,RDWR
.
- access
Group stringId - The resource ID of the Access Group.
- access
Rule stringId - The ID of the Access Rule.
- create
Time string - The created time of the Access Rule.
- description string
- The description of the Access Rule.
- id string
- The resource ID of Access Rule.
- network
Segment string - The NetworkSegment of the Access Rule.
- priority number
- The priority of the Access Rule.
- rw
Access stringType - RWAccessType of the Access Rule. Valid values:
RDONLY
,RDWR
.
- access_
group_ strid - The resource ID of the Access Group.
- access_
rule_ strid - 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_ strtype - RWAccessType of the Access Rule. Valid values:
RDONLY
,RDWR
.
- access
Group StringId - The resource ID of the Access Group.
- access
Rule StringId - The ID of the Access Rule.
- create
Time String - The created time of the Access Rule.
- description String
- The description of the Access Rule.
- id String
- The resource ID of Access Rule.
- network
Segment String - The NetworkSegment of the Access Rule.
- priority Number
- The priority of the Access Rule.
- rw
Access StringType - 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.