Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.27.0 published on Monday, Aug 8, 2022 by Pulumi

AccessRule

Provides a Nas Access Rule resource.

When NAS is activated, the Default VPC Permission Group is automatically generated. It allows all IP addresses in a VPC to access the mount point with full permissions. Full permissions include Read/Write permission with no restriction on root users.

NOTE: Available in v1.34.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var fooAccessGroup = new AliCloud.Nas.AccessGroup("fooAccessGroup", new AliCloud.Nas.AccessGroupArgs
        {
            AccessGroupName = "tf-NasConfigName",
            AccessGroupType = "Vpc",
            Description = "tf-testAccNasConfig",
        });
        var fooAccessRule = new AliCloud.Nas.AccessRule("fooAccessRule", new AliCloud.Nas.AccessRuleArgs
        {
            AccessGroupName = fooAccessGroup.AccessGroupName,
            SourceCidrIp = "168.1.1.0/16",
            RwAccessType = "RDWR",
            UserAccessType = "no_squash",
            Priority = 2,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooAccessGroup, err := nas.NewAccessGroup(ctx, "fooAccessGroup", &nas.AccessGroupArgs{
			AccessGroupName: pulumi.String("tf-NasConfigName"),
			AccessGroupType: pulumi.String("Vpc"),
			Description:     pulumi.String("tf-testAccNasConfig"),
		})
		if err != nil {
			return err
		}
		_, err = nas.NewAccessRule(ctx, "fooAccessRule", &nas.AccessRuleArgs{
			AccessGroupName: fooAccessGroup.AccessGroupName,
			SourceCidrIp:    pulumi.String("168.1.1.0/16"),
			RwAccessType:    pulumi.String("RDWR"),
			UserAccessType:  pulumi.String("no_squash"),
			Priority:        pulumi.Int(2),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.nas.AccessGroup;
import com.pulumi.alicloud.nas.AccessGroupArgs;
import com.pulumi.alicloud.nas.AccessRule;
import com.pulumi.alicloud.nas.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) {
        var fooAccessGroup = new AccessGroup("fooAccessGroup", AccessGroupArgs.builder()        
            .accessGroupName("tf-NasConfigName")
            .accessGroupType("Vpc")
            .description("tf-testAccNasConfig")
            .build());

        var fooAccessRule = new AccessRule("fooAccessRule", AccessRuleArgs.builder()        
            .accessGroupName(fooAccessGroup.accessGroupName())
            .sourceCidrIp("168.1.1.0/16")
            .rwAccessType("RDWR")
            .userAccessType("no_squash")
            .priority(2)
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

foo_access_group = alicloud.nas.AccessGroup("fooAccessGroup",
    access_group_name="tf-NasConfigName",
    access_group_type="Vpc",
    description="tf-testAccNasConfig")
foo_access_rule = alicloud.nas.AccessRule("fooAccessRule",
    access_group_name=foo_access_group.access_group_name,
    source_cidr_ip="168.1.1.0/16",
    rw_access_type="RDWR",
    user_access_type="no_squash",
    priority=2)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const fooAccessGroup = new alicloud.nas.AccessGroup("fooAccessGroup", {
    accessGroupName: "tf-NasConfigName",
    accessGroupType: "Vpc",
    description: "tf-testAccNasConfig",
});
const fooAccessRule = new alicloud.nas.AccessRule("fooAccessRule", {
    accessGroupName: fooAccessGroup.accessGroupName,
    sourceCidrIp: "168.1.1.0/16",
    rwAccessType: "RDWR",
    userAccessType: "no_squash",
    priority: 2,
});
resources:
  fooAccessGroup:
    type: alicloud:nas:AccessGroup
    properties:
      accessGroupName: tf-NasConfigName
      accessGroupType: Vpc
      description: tf-testAccNasConfig
  fooAccessRule:
    type: alicloud:nas:AccessRule
    properties:
      accessGroupName: ${fooAccessGroup.accessGroupName}
      sourceCidrIp: 168.1.1.0/16
      rwAccessType: RDWR
      userAccessType: no_squash
      priority: 2

Create a AccessRule Resource

new AccessRule(name: string, args: AccessRuleArgs, opts?: CustomResourceOptions);
@overload
def AccessRule(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               access_group_name: Optional[str] = None,
               priority: Optional[int] = None,
               rw_access_type: Optional[str] = None,
               source_cidr_ip: Optional[str] = None,
               user_access_type: Optional[str] = None)
@overload
def AccessRule(resource_name: str,
               args: AccessRuleArgs,
               opts: Optional[ResourceOptions] = 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:nas:AccessRule
properties: # The arguments to resource properties.
options: # 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.
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.

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

The AccessRule resource accepts the following input properties:

AccessGroupName string

Permission group name.

SourceCidrIp string

Address or address segment.

Priority int

Priority level. Range: 1-100. Default value: 1.

RwAccessType string

Read-write permission type: RDWR (default), RDONLY.

UserAccessType string

User permission type: no_squash (default), root_squash, all_squash.

AccessGroupName string

Permission group name.

SourceCidrIp string

Address or address segment.

Priority int

Priority level. Range: 1-100. Default value: 1.

RwAccessType string

Read-write permission type: RDWR (default), RDONLY.

UserAccessType string

User permission type: no_squash (default), root_squash, all_squash.

accessGroupName String

Permission group name.

sourceCidrIp String

Address or address segment.

priority Integer

Priority level. Range: 1-100. Default value: 1.

rwAccessType String

Read-write permission type: RDWR (default), RDONLY.

userAccessType String

User permission type: no_squash (default), root_squash, all_squash.

accessGroupName string

Permission group name.

sourceCidrIp string

Address or address segment.

priority number

Priority level. Range: 1-100. Default value: 1.

rwAccessType string

Read-write permission type: RDWR (default), RDONLY.

userAccessType string

User permission type: no_squash (default), root_squash, all_squash.

access_group_name str

Permission group name.

source_cidr_ip str

Address or address segment.

priority int

Priority level. Range: 1-100. Default value: 1.

rw_access_type str

Read-write permission type: RDWR (default), RDONLY.

user_access_type str

User permission type: no_squash (default), root_squash, all_squash.

accessGroupName String

Permission group name.

sourceCidrIp String

Address or address segment.

priority Number

Priority level. Range: 1-100. Default value: 1.

rwAccessType String

Read-write permission type: RDWR (default), RDONLY.

userAccessType String

User permission type: no_squash (default), root_squash, all_squash.

Outputs

All input properties are implicitly available as output properties. Additionally, the AccessRule resource produces the following output properties:

AccessRuleId string

The nas access rule ID.

Id string

The provider-assigned unique ID for this managed resource.

AccessRuleId string

The nas access rule ID.

Id string

The provider-assigned unique ID for this managed resource.

accessRuleId String

The nas access rule ID.

id String

The provider-assigned unique ID for this managed resource.

accessRuleId string

The nas access rule ID.

id string

The provider-assigned unique ID for this managed resource.

access_rule_id str

The nas access rule ID.

id str

The provider-assigned unique ID for this managed resource.

accessRuleId String

The nas access rule ID.

id String

The provider-assigned unique ID for this managed resource.

Look up an 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_name: Optional[str] = None,
        access_rule_id: Optional[str] = None,
        priority: Optional[int] = None,
        rw_access_type: Optional[str] = None,
        source_cidr_ip: Optional[str] = None,
        user_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.
The following state arguments are supported:
AccessGroupName string

Permission group name.

AccessRuleId string

The nas access rule ID.

Priority int

Priority level. Range: 1-100. Default value: 1.

RwAccessType string

Read-write permission type: RDWR (default), RDONLY.

SourceCidrIp string

Address or address segment.

UserAccessType string

User permission type: no_squash (default), root_squash, all_squash.

AccessGroupName string

Permission group name.

AccessRuleId string

The nas access rule ID.

Priority int

Priority level. Range: 1-100. Default value: 1.

RwAccessType string

Read-write permission type: RDWR (default), RDONLY.

SourceCidrIp string

Address or address segment.

UserAccessType string

User permission type: no_squash (default), root_squash, all_squash.

accessGroupName String

Permission group name.

accessRuleId String

The nas access rule ID.

priority Integer

Priority level. Range: 1-100. Default value: 1.

rwAccessType String

Read-write permission type: RDWR (default), RDONLY.

sourceCidrIp String

Address or address segment.

userAccessType String

User permission type: no_squash (default), root_squash, all_squash.

accessGroupName string

Permission group name.

accessRuleId string

The nas access rule ID.

priority number

Priority level. Range: 1-100. Default value: 1.

rwAccessType string

Read-write permission type: RDWR (default), RDONLY.

sourceCidrIp string

Address or address segment.

userAccessType string

User permission type: no_squash (default), root_squash, all_squash.

access_group_name str

Permission group name.

access_rule_id str

The nas access rule ID.

priority int

Priority level. Range: 1-100. Default value: 1.

rw_access_type str

Read-write permission type: RDWR (default), RDONLY.

source_cidr_ip str

Address or address segment.

user_access_type str

User permission type: no_squash (default), root_squash, all_squash.

accessGroupName String

Permission group name.

accessRuleId String

The nas access rule ID.

priority Number

Priority level. Range: 1-100. Default value: 1.

rwAccessType String

Read-write permission type: RDWR (default), RDONLY.

sourceCidrIp String

Address or address segment.

userAccessType String

User permission type: no_squash (default), root_squash, all_squash.

Import

Nas Access Rule can be imported using the id, e.g.

 $ pulumi import alicloud:nas/accessRule:AccessRule foo tf-testAccNasConfigName:1

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.