1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. nas
  5. AccessRule
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.nas.AccessRule

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    Provides a NAS Access Rule resource.

    For information about NAS Access Rule and how to use it, see What is Access Rule.

    NOTE: Available since v1.34.0.

    Example Usage

    Basic Usage

    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,
    });
    
    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)
    
    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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var fooAccessGroup = new AliCloud.Nas.AccessGroup("fooAccessGroup", new()
        {
            AccessGroupName = "tf-NasConfigName",
            AccessGroupType = "Vpc",
            Description = "tf-testAccNasConfig",
        });
    
        var fooAccessRule = new AliCloud.Nas.AccessRule("fooAccessRule", new()
        {
            AccessGroupName = fooAccessGroup.AccessGroupName,
            SourceCidrIp = "168.1.1.0/16",
            RwAccessType = "RDWR",
            UserAccessType = "no_squash",
            Priority = 2,
        });
    
    });
    
    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());
    
        }
    }
    
    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 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,
                   file_system_type: Optional[str] = None,
                   ipv6_source_cidr_ip: 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
    AccessGroupName.
    FileSystemType string
    filesystem type. include standard, extreme.
    Ipv6SourceCidrIp string
    Ipv6SourceCidrIp.
    Priority int
    Priority.
    RwAccessType string
    RWAccess.
    SourceCidrIp string
    SourceCidrIp.
    UserAccessType string
    UserAccess.
    AccessGroupName string
    AccessGroupName.
    FileSystemType string
    filesystem type. include standard, extreme.
    Ipv6SourceCidrIp string
    Ipv6SourceCidrIp.
    Priority int
    Priority.
    RwAccessType string
    RWAccess.
    SourceCidrIp string
    SourceCidrIp.
    UserAccessType string
    UserAccess.
    accessGroupName String
    AccessGroupName.
    fileSystemType String
    filesystem type. include standard, extreme.
    ipv6SourceCidrIp String
    Ipv6SourceCidrIp.
    priority Integer
    Priority.
    rwAccessType String
    RWAccess.
    sourceCidrIp String
    SourceCidrIp.
    userAccessType String
    UserAccess.
    accessGroupName string
    AccessGroupName.
    fileSystemType string
    filesystem type. include standard, extreme.
    ipv6SourceCidrIp string
    Ipv6SourceCidrIp.
    priority number
    Priority.
    rwAccessType string
    RWAccess.
    sourceCidrIp string
    SourceCidrIp.
    userAccessType string
    UserAccess.
    access_group_name str
    AccessGroupName.
    file_system_type str
    filesystem type. include standard, extreme.
    ipv6_source_cidr_ip str
    Ipv6SourceCidrIp.
    priority int
    Priority.
    rw_access_type str
    RWAccess.
    source_cidr_ip str
    SourceCidrIp.
    user_access_type str
    UserAccess.
    accessGroupName String
    AccessGroupName.
    fileSystemType String
    filesystem type. include standard, extreme.
    ipv6SourceCidrIp String
    Ipv6SourceCidrIp.
    priority Number
    Priority.
    rwAccessType String
    RWAccess.
    sourceCidrIp String
    SourceCidrIp.
    userAccessType String
    UserAccess.

    Outputs

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

    AccessRuleId string
    The first ID of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    AccessRuleId string
    The first ID of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    accessRuleId String
    The first ID of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    accessRuleId string
    The first ID of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    access_rule_id str
    The first ID of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    accessRuleId String
    The first ID of the resource.
    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_name: Optional[str] = None,
            access_rule_id: Optional[str] = None,
            file_system_type: Optional[str] = None,
            ipv6_source_cidr_ip: 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
    AccessGroupName.
    AccessRuleId string
    The first ID of the resource.
    FileSystemType string
    filesystem type. include standard, extreme.
    Ipv6SourceCidrIp string
    Ipv6SourceCidrIp.
    Priority int
    Priority.
    RwAccessType string
    RWAccess.
    SourceCidrIp string
    SourceCidrIp.
    UserAccessType string
    UserAccess.
    AccessGroupName string
    AccessGroupName.
    AccessRuleId string
    The first ID of the resource.
    FileSystemType string
    filesystem type. include standard, extreme.
    Ipv6SourceCidrIp string
    Ipv6SourceCidrIp.
    Priority int
    Priority.
    RwAccessType string
    RWAccess.
    SourceCidrIp string
    SourceCidrIp.
    UserAccessType string
    UserAccess.
    accessGroupName String
    AccessGroupName.
    accessRuleId String
    The first ID of the resource.
    fileSystemType String
    filesystem type. include standard, extreme.
    ipv6SourceCidrIp String
    Ipv6SourceCidrIp.
    priority Integer
    Priority.
    rwAccessType String
    RWAccess.
    sourceCidrIp String
    SourceCidrIp.
    userAccessType String
    UserAccess.
    accessGroupName string
    AccessGroupName.
    accessRuleId string
    The first ID of the resource.
    fileSystemType string
    filesystem type. include standard, extreme.
    ipv6SourceCidrIp string
    Ipv6SourceCidrIp.
    priority number
    Priority.
    rwAccessType string
    RWAccess.
    sourceCidrIp string
    SourceCidrIp.
    userAccessType string
    UserAccess.
    access_group_name str
    AccessGroupName.
    access_rule_id str
    The first ID of the resource.
    file_system_type str
    filesystem type. include standard, extreme.
    ipv6_source_cidr_ip str
    Ipv6SourceCidrIp.
    priority int
    Priority.
    rw_access_type str
    RWAccess.
    source_cidr_ip str
    SourceCidrIp.
    user_access_type str
    UserAccess.
    accessGroupName String
    AccessGroupName.
    accessRuleId String
    The first ID of the resource.
    fileSystemType String
    filesystem type. include standard, extreme.
    ipv6SourceCidrIp String
    Ipv6SourceCidrIp.
    priority Number
    Priority.
    rwAccessType String
    RWAccess.
    sourceCidrIp String
    SourceCidrIp.
    userAccessType String
    UserAccess.

    Import

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

    $ pulumi import alicloud:nas/accessRule:AccessRule example <access_group_name>:<file_system_type>:<access_rule_id>
    

    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.51.0 published on Saturday, Mar 23, 2024 by Pulumi