alicloud.dfs.AccessRule
Explore with Pulumi AI
Provides a DFS Access Rule resource.
For information about DFS Access Rule and how to use it, see What is Access Rule.
NOTE: Available since v1.140.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "example_name";
const _default = new alicloud.dfs.AccessGroup("default", {
networkType: "VPC",
accessGroupName: name,
description: name,
});
const defaultAccessRule = new alicloud.dfs.AccessRule("default", {
networkSegment: "192.0.2.0/24",
accessGroupId: _default.id,
description: name,
rwAccessType: "RDWR",
priority: 10,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "example_name"
default = alicloud.dfs.AccessGroup("default",
network_type="VPC",
access_group_name=name,
description=name)
default_access_rule = alicloud.dfs.AccessRule("default",
network_segment="192.0.2.0/24",
access_group_id=default.id,
description=name,
rw_access_type="RDWR",
priority=10)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dfs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "example_name"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := dfs.NewAccessGroup(ctx, "default", &dfs.AccessGroupArgs{
NetworkType: pulumi.String("VPC"),
AccessGroupName: pulumi.String(name),
Description: pulumi.String(name),
})
if err != nil {
return err
}
_, err = dfs.NewAccessRule(ctx, "default", &dfs.AccessRuleArgs{
NetworkSegment: pulumi.String("192.0.2.0/24"),
AccessGroupId: _default.ID(),
Description: pulumi.String(name),
RwAccessType: pulumi.String("RDWR"),
Priority: pulumi.Int(10),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "example_name";
var @default = new AliCloud.Dfs.AccessGroup("default", new()
{
NetworkType = "VPC",
AccessGroupName = name,
Description = name,
});
var defaultAccessRule = new AliCloud.Dfs.AccessRule("default", new()
{
NetworkSegment = "192.0.2.0/24",
AccessGroupId = @default.Id,
Description = name,
RwAccessType = "RDWR",
Priority = 10,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.dfs.AccessGroup;
import com.pulumi.alicloud.dfs.AccessGroupArgs;
import com.pulumi.alicloud.dfs.AccessRule;
import com.pulumi.alicloud.dfs.AccessRuleArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("example_name");
var default_ = new AccessGroup("default", AccessGroupArgs.builder()
.networkType("VPC")
.accessGroupName(name)
.description(name)
.build());
var defaultAccessRule = new AccessRule("defaultAccessRule", AccessRuleArgs.builder()
.networkSegment("192.0.2.0/24")
.accessGroupId(default_.id())
.description(name)
.rwAccessType("RDWR")
.priority("10")
.build());
}
}
configuration:
name:
type: string
default: example_name
resources:
default:
type: alicloud:dfs:AccessGroup
properties:
networkType: VPC
accessGroupName: ${name}
description: ${name}
defaultAccessRule:
type: alicloud:dfs:AccessRule
name: default
properties:
networkSegment: 192.0.2.0/24
accessGroupId: ${default.id}
description: ${name}
rwAccessType: RDWR
priority: '10'
Create AccessRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AccessRule(name: string, args: AccessRuleArgs, opts?: CustomResourceOptions);
@overload
def AccessRule(resource_name: str,
args: AccessRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AccessRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
access_group_id: Optional[str] = None,
network_segment: Optional[str] = None,
priority: Optional[int] = None,
rw_access_type: Optional[str] = None,
description: Optional[str] = None)
func NewAccessRule(ctx *Context, name string, args AccessRuleArgs, opts ...ResourceOption) (*AccessRule, error)
public AccessRule(string name, AccessRuleArgs args, CustomResourceOptions? opts = null)
public AccessRule(String name, AccessRuleArgs args)
public AccessRule(String name, AccessRuleArgs args, CustomResourceOptions options)
type: alicloud:dfs:AccessRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AccessRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AccessRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AccessRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AccessRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AccessRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var accessRuleResource = new AliCloud.Dfs.AccessRule("accessRuleResource", new()
{
AccessGroupId = "string",
NetworkSegment = "string",
Priority = 0,
RwAccessType = "string",
Description = "string",
});
example, err := dfs.NewAccessRule(ctx, "accessRuleResource", &dfs.AccessRuleArgs{
AccessGroupId: pulumi.String("string"),
NetworkSegment: pulumi.String("string"),
Priority: pulumi.Int(0),
RwAccessType: pulumi.String("string"),
Description: pulumi.String("string"),
})
var accessRuleResource = new AccessRule("accessRuleResource", AccessRuleArgs.builder()
.accessGroupId("string")
.networkSegment("string")
.priority(0)
.rwAccessType("string")
.description("string")
.build());
access_rule_resource = alicloud.dfs.AccessRule("accessRuleResource",
access_group_id="string",
network_segment="string",
priority=0,
rw_access_type="string",
description="string")
const accessRuleResource = new alicloud.dfs.AccessRule("accessRuleResource", {
accessGroupId: "string",
networkSegment: "string",
priority: 0,
rwAccessType: "string",
description: "string",
});
type: alicloud:dfs:AccessRule
properties:
accessGroupId: string
description: string
networkSegment: string
priority: 0
rwAccessType: string
AccessRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AccessRule resource accepts the following input properties:
- Access
Group stringId - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- Network
Segment string - The IP address or network segment of the authorized object.
- Priority int
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- Rw
Access stringType - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
- Description string
- Permission rule description. No more than 32 characters in length.
- Access
Group stringId - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- Network
Segment string - The IP address or network segment of the authorized object.
- Priority int
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- Rw
Access stringType - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
- Description string
- Permission rule description. No more than 32 characters in length.
- access
Group StringId - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- network
Segment String - The IP address or network segment of the authorized object.
- priority Integer
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- rw
Access StringType - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
- description String
- Permission rule description. No more than 32 characters in length.
- access
Group stringId - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- network
Segment string - The IP address or network segment of the authorized object.
- priority number
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- rw
Access stringType - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
- description string
- Permission rule description. No more than 32 characters in length.
- access_
group_ strid - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- network_
segment str - The IP address or network segment of the authorized object.
- priority int
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- rw_
access_ strtype - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
- description str
- Permission rule description. No more than 32 characters in length.
- access
Group StringId - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- network
Segment String - The IP address or network segment of the authorized object.
- priority Number
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- rw
Access StringType - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
- description String
- Permission rule description. No more than 32 characters in length.
Outputs
All input properties are implicitly available as output properties. Additionally, the AccessRule resource produces the following output properties:
- Access
Rule stringId - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- Create
Time string - Permission rule resource creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Access
Rule stringId - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- Create
Time string - Permission rule resource creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- access
Rule StringId - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- create
Time String - Permission rule resource creation time.
- id String
- The provider-assigned unique ID for this managed resource.
- access
Rule stringId - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- create
Time string - Permission rule resource creation time.
- id string
- The provider-assigned unique ID for this managed resource.
- access_
rule_ strid - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- create_
time str - Permission rule resource creation time.
- id str
- The provider-assigned unique ID for this managed resource.
- access
Rule StringId - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- create
Time String - Permission rule resource creation time.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing AccessRule Resource
Get an existing AccessRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AccessRuleState, opts?: CustomResourceOptions): AccessRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_group_id: Optional[str] = None,
access_rule_id: Optional[str] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
network_segment: Optional[str] = None,
priority: Optional[int] = None,
rw_access_type: Optional[str] = None) -> AccessRule
func GetAccessRule(ctx *Context, name string, id IDInput, state *AccessRuleState, opts ...ResourceOption) (*AccessRule, error)
public static AccessRule Get(string name, Input<string> id, AccessRuleState? state, CustomResourceOptions? opts = null)
public static AccessRule get(String name, Output<String> id, AccessRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Access
Group stringId - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- Access
Rule stringId - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- Create
Time string - Permission rule resource creation time.
- Description string
- Permission rule description. No more than 32 characters in length.
- Network
Segment string - The IP address or network segment of the authorized object.
- Priority int
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- Rw
Access stringType - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
- Access
Group stringId - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- Access
Rule stringId - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- Create
Time string - Permission rule resource creation time.
- Description string
- Permission rule description. No more than 32 characters in length.
- Network
Segment string - The IP address or network segment of the authorized object.
- Priority int
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- Rw
Access stringType - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
- access
Group StringId - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- access
Rule StringId - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- create
Time String - Permission rule resource creation time.
- description String
- Permission rule description. No more than 32 characters in length.
- network
Segment String - The IP address or network segment of the authorized object.
- priority Integer
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- rw
Access StringType - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
- access
Group stringId - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- access
Rule stringId - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- create
Time string - Permission rule resource creation time.
- description string
- Permission rule description. No more than 32 characters in length.
- network
Segment string - The IP address or network segment of the authorized object.
- priority number
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- rw
Access stringType - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
- access_
group_ strid - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- access_
rule_ strid - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- create_
time str - Permission rule resource creation time.
- description str
- Permission rule description. No more than 32 characters in length.
- network_
segment str - The IP address or network segment of the authorized object.
- priority int
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- rw_
access_ strtype - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
- access
Group StringId - Permission group resource ID. You must specify the permission group ID when creating a permission rule.
- access
Rule StringId - The unique identity of the permission rule, which is used to retrieve the permission rule for a specific day in the permission group.
- create
Time String - Permission rule resource creation time.
- description String
- Permission rule description. No more than 32 characters in length.
- network
Segment String - The IP address or network segment of the authorized object.
- priority Number
- Permission rule priority. When the same authorization object matches multiple rules, the high-priority rule takes effect. Value range: 1~100,1 is the highest priority.
- rw
Access StringType - The read and write permissions of the authorized object on the file system. Value: RDWR: readable and writable RDONLY: Read only.
Import
DFS Access Rule can be imported using the id, e.g.
$ pulumi import alicloud:dfs/accessRule:AccessRule example <access_group_id>:<access_rule_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.