1. Packages
  2. Opentelekomcloud Provider
  3. API Docs
  4. SfsShareAccessRulesV2
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

opentelekomcloud.SfsShareAccessRulesV2

Explore with Pulumi AI

opentelekomcloud logo
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

    Up-to-date reference of API arguments for SFS access rules you can get at documentation portal

    Provides a possibility to manage access rules of Scalable File System resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opentelekomcloud from "@pulumi/opentelekomcloud";
    
    const config = new pulumi.Config();
    const shareName = config.requireObject("shareName");
    const shareDescription = config.requireObject("shareDescription");
    const vpc1 = new opentelekomcloud.VpcV1("vpc1", {cidr: "192.168.0.0/16"});
    const vpc2 = new opentelekomcloud.VpcV1("vpc2", {cidr: "192.168.0.0/16"});
    const sfs1 = new opentelekomcloud.SfsFileSystemV2("sfs1", {
        size: 50,
        description: shareDescription,
        shareProto: "NFS",
    });
    const sfsRules = new opentelekomcloud.SfsShareAccessRulesV2("sfsRules", {
        shareId: sfs1.sfsFileSystemV2Id,
        accessRules: [
            {
                accessTo: vpc1.vpcV1Id,
                accessType: "cert",
                accessLevel: "rw",
            },
            {
                accessTo: vpc2.vpcV1Id,
                accessType: "cert",
                accessLevel: "rw",
            },
        ],
    });
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    config = pulumi.Config()
    share_name = config.require_object("shareName")
    share_description = config.require_object("shareDescription")
    vpc1 = opentelekomcloud.VpcV1("vpc1", cidr="192.168.0.0/16")
    vpc2 = opentelekomcloud.VpcV1("vpc2", cidr="192.168.0.0/16")
    sfs1 = opentelekomcloud.SfsFileSystemV2("sfs1",
        size=50,
        description=share_description,
        share_proto="NFS")
    sfs_rules = opentelekomcloud.SfsShareAccessRulesV2("sfsRules",
        share_id=sfs1.sfs_file_system_v2_id,
        access_rules=[
            {
                "access_to": vpc1.vpc_v1_id,
                "access_type": "cert",
                "access_level": "rw",
            },
            {
                "access_to": vpc2.vpc_v1_id,
                "access_type": "cert",
                "access_level": "rw",
            },
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
    	"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, "")
    		shareName := cfg.RequireObject("shareName")
    		shareDescription := cfg.RequireObject("shareDescription")
    		vpc1, err := opentelekomcloud.NewVpcV1(ctx, "vpc1", &opentelekomcloud.VpcV1Args{
    			Cidr: pulumi.String("192.168.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		vpc2, err := opentelekomcloud.NewVpcV1(ctx, "vpc2", &opentelekomcloud.VpcV1Args{
    			Cidr: pulumi.String("192.168.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		sfs1, err := opentelekomcloud.NewSfsFileSystemV2(ctx, "sfs1", &opentelekomcloud.SfsFileSystemV2Args{
    			Size:        pulumi.Float64(50),
    			Description: pulumi.Any(shareDescription),
    			ShareProto:  pulumi.String("NFS"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = opentelekomcloud.NewSfsShareAccessRulesV2(ctx, "sfsRules", &opentelekomcloud.SfsShareAccessRulesV2Args{
    			ShareId: sfs1.SfsFileSystemV2Id,
    			AccessRules: opentelekomcloud.SfsShareAccessRulesV2AccessRuleArray{
    				&opentelekomcloud.SfsShareAccessRulesV2AccessRuleArgs{
    					AccessTo:    vpc1.VpcV1Id,
    					AccessType:  pulumi.String("cert"),
    					AccessLevel: pulumi.String("rw"),
    				},
    				&opentelekomcloud.SfsShareAccessRulesV2AccessRuleArgs{
    					AccessTo:    vpc2.VpcV1Id,
    					AccessType:  pulumi.String("cert"),
    					AccessLevel: pulumi.String("rw"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opentelekomcloud = Pulumi.Opentelekomcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var shareName = config.RequireObject<dynamic>("shareName");
        var shareDescription = config.RequireObject<dynamic>("shareDescription");
        var vpc1 = new Opentelekomcloud.VpcV1("vpc1", new()
        {
            Cidr = "192.168.0.0/16",
        });
    
        var vpc2 = new Opentelekomcloud.VpcV1("vpc2", new()
        {
            Cidr = "192.168.0.0/16",
        });
    
        var sfs1 = new Opentelekomcloud.SfsFileSystemV2("sfs1", new()
        {
            Size = 50,
            Description = shareDescription,
            ShareProto = "NFS",
        });
    
        var sfsRules = new Opentelekomcloud.SfsShareAccessRulesV2("sfsRules", new()
        {
            ShareId = sfs1.SfsFileSystemV2Id,
            AccessRules = new[]
            {
                new Opentelekomcloud.Inputs.SfsShareAccessRulesV2AccessRuleArgs
                {
                    AccessTo = vpc1.VpcV1Id,
                    AccessType = "cert",
                    AccessLevel = "rw",
                },
                new Opentelekomcloud.Inputs.SfsShareAccessRulesV2AccessRuleArgs
                {
                    AccessTo = vpc2.VpcV1Id,
                    AccessType = "cert",
                    AccessLevel = "rw",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opentelekomcloud.VpcV1;
    import com.pulumi.opentelekomcloud.VpcV1Args;
    import com.pulumi.opentelekomcloud.SfsFileSystemV2;
    import com.pulumi.opentelekomcloud.SfsFileSystemV2Args;
    import com.pulumi.opentelekomcloud.SfsShareAccessRulesV2;
    import com.pulumi.opentelekomcloud.SfsShareAccessRulesV2Args;
    import com.pulumi.opentelekomcloud.inputs.SfsShareAccessRulesV2AccessRuleArgs;
    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 shareName = config.get("shareName");
            final var shareDescription = config.get("shareDescription");
            var vpc1 = new VpcV1("vpc1", VpcV1Args.builder()
                .cidr("192.168.0.0/16")
                .build());
    
            var vpc2 = new VpcV1("vpc2", VpcV1Args.builder()
                .cidr("192.168.0.0/16")
                .build());
    
            var sfs1 = new SfsFileSystemV2("sfs1", SfsFileSystemV2Args.builder()
                .size(50)
                .description(shareDescription)
                .shareProto("NFS")
                .build());
    
            var sfsRules = new SfsShareAccessRulesV2("sfsRules", SfsShareAccessRulesV2Args.builder()
                .shareId(sfs1.sfsFileSystemV2Id())
                .accessRules(            
                    SfsShareAccessRulesV2AccessRuleArgs.builder()
                        .accessTo(vpc1.vpcV1Id())
                        .accessType("cert")
                        .accessLevel("rw")
                        .build(),
                    SfsShareAccessRulesV2AccessRuleArgs.builder()
                        .accessTo(vpc2.vpcV1Id())
                        .accessType("cert")
                        .accessLevel("rw")
                        .build())
                .build());
    
        }
    }
    
    configuration:
      shareName:
        type: dynamic
      shareDescription:
        type: dynamic
    resources:
      vpc1:
        type: opentelekomcloud:VpcV1
        properties:
          cidr: 192.168.0.0/16
      vpc2:
        type: opentelekomcloud:VpcV1
        properties:
          cidr: 192.168.0.0/16
      sfs1:
        type: opentelekomcloud:SfsFileSystemV2
        properties:
          size: 50
          description: ${shareDescription}
          shareProto: NFS
      sfsRules:
        type: opentelekomcloud:SfsShareAccessRulesV2
        properties:
          shareId: ${sfs1.sfsFileSystemV2Id}
          accessRules:
            - accessTo: ${vpc1.vpcV1Id}
              accessType: cert
              accessLevel: rw
            - accessTo: ${vpc2.vpcV1Id}
              accessType: cert
              accessLevel: rw
    

    Create SfsShareAccessRulesV2 Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SfsShareAccessRulesV2(name: string, args: SfsShareAccessRulesV2Args, opts?: CustomResourceOptions);
    @overload
    def SfsShareAccessRulesV2(resource_name: str,
                              args: SfsShareAccessRulesV2Args,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def SfsShareAccessRulesV2(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              access_rules: Optional[Sequence[SfsShareAccessRulesV2AccessRuleArgs]] = None,
                              share_id: Optional[str] = None,
                              sfs_share_access_rules_v2_id: Optional[str] = None)
    func NewSfsShareAccessRulesV2(ctx *Context, name string, args SfsShareAccessRulesV2Args, opts ...ResourceOption) (*SfsShareAccessRulesV2, error)
    public SfsShareAccessRulesV2(string name, SfsShareAccessRulesV2Args args, CustomResourceOptions? opts = null)
    public SfsShareAccessRulesV2(String name, SfsShareAccessRulesV2Args args)
    public SfsShareAccessRulesV2(String name, SfsShareAccessRulesV2Args args, CustomResourceOptions options)
    
    type: opentelekomcloud:SfsShareAccessRulesV2
    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 SfsShareAccessRulesV2Args
    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 SfsShareAccessRulesV2Args
    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 SfsShareAccessRulesV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SfsShareAccessRulesV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SfsShareAccessRulesV2Args
    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 sfsShareAccessRulesV2Resource = new Opentelekomcloud.SfsShareAccessRulesV2("sfsShareAccessRulesV2Resource", new()
    {
        AccessRules = new[]
        {
            new Opentelekomcloud.Inputs.SfsShareAccessRulesV2AccessRuleArgs
            {
                AccessLevel = "string",
                AccessTo = "string",
                AccessRuleStatus = "string",
                AccessType = "string",
                ShareAccessId = "string",
            },
        },
        ShareId = "string",
        SfsShareAccessRulesV2Id = "string",
    });
    
    example, err := opentelekomcloud.NewSfsShareAccessRulesV2(ctx, "sfsShareAccessRulesV2Resource", &opentelekomcloud.SfsShareAccessRulesV2Args{
    	AccessRules: opentelekomcloud.SfsShareAccessRulesV2AccessRuleArray{
    		&opentelekomcloud.SfsShareAccessRulesV2AccessRuleArgs{
    			AccessLevel:      pulumi.String("string"),
    			AccessTo:         pulumi.String("string"),
    			AccessRuleStatus: pulumi.String("string"),
    			AccessType:       pulumi.String("string"),
    			ShareAccessId:    pulumi.String("string"),
    		},
    	},
    	ShareId:                 pulumi.String("string"),
    	SfsShareAccessRulesV2Id: pulumi.String("string"),
    })
    
    var sfsShareAccessRulesV2Resource = new SfsShareAccessRulesV2("sfsShareAccessRulesV2Resource", SfsShareAccessRulesV2Args.builder()
        .accessRules(SfsShareAccessRulesV2AccessRuleArgs.builder()
            .accessLevel("string")
            .accessTo("string")
            .accessRuleStatus("string")
            .accessType("string")
            .shareAccessId("string")
            .build())
        .shareId("string")
        .sfsShareAccessRulesV2Id("string")
        .build());
    
    sfs_share_access_rules_v2_resource = opentelekomcloud.SfsShareAccessRulesV2("sfsShareAccessRulesV2Resource",
        access_rules=[{
            "access_level": "string",
            "access_to": "string",
            "access_rule_status": "string",
            "access_type": "string",
            "share_access_id": "string",
        }],
        share_id="string",
        sfs_share_access_rules_v2_id="string")
    
    const sfsShareAccessRulesV2Resource = new opentelekomcloud.SfsShareAccessRulesV2("sfsShareAccessRulesV2Resource", {
        accessRules: [{
            accessLevel: "string",
            accessTo: "string",
            accessRuleStatus: "string",
            accessType: "string",
            shareAccessId: "string",
        }],
        shareId: "string",
        sfsShareAccessRulesV2Id: "string",
    });
    
    type: opentelekomcloud:SfsShareAccessRulesV2
    properties:
        accessRules:
            - accessLevel: string
              accessRuleStatus: string
              accessTo: string
              accessType: string
              shareAccessId: string
        sfsShareAccessRulesV2Id: string
        shareId: string
    

    SfsShareAccessRulesV2 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 SfsShareAccessRulesV2 resource accepts the following input properties:

    AccessRules List<SfsShareAccessRulesV2AccessRule>
    Specifies the access rules of SFS file share. Structure is documented below.
    ShareId string
    The UUID of the shared file system.
    SfsShareAccessRulesV2Id string
    AccessRules []SfsShareAccessRulesV2AccessRuleArgs
    Specifies the access rules of SFS file share. Structure is documented below.
    ShareId string
    The UUID of the shared file system.
    SfsShareAccessRulesV2Id string
    accessRules List<SfsShareAccessRulesV2AccessRule>
    Specifies the access rules of SFS file share. Structure is documented below.
    shareId String
    The UUID of the shared file system.
    sfsShareAccessRulesV2Id String
    accessRules SfsShareAccessRulesV2AccessRule[]
    Specifies the access rules of SFS file share. Structure is documented below.
    shareId string
    The UUID of the shared file system.
    sfsShareAccessRulesV2Id string
    access_rules Sequence[SfsShareAccessRulesV2AccessRuleArgs]
    Specifies the access rules of SFS file share. Structure is documented below.
    share_id str
    The UUID of the shared file system.
    sfs_share_access_rules_v2_id str
    accessRules List<Property Map>
    Specifies the access rules of SFS file share. Structure is documented below.
    shareId String
    The UUID of the shared file system.
    sfsShareAccessRulesV2Id String

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing SfsShareAccessRulesV2 Resource

    Get an existing SfsShareAccessRulesV2 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?: SfsShareAccessRulesV2State, opts?: CustomResourceOptions): SfsShareAccessRulesV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_rules: Optional[Sequence[SfsShareAccessRulesV2AccessRuleArgs]] = None,
            sfs_share_access_rules_v2_id: Optional[str] = None,
            share_id: Optional[str] = None) -> SfsShareAccessRulesV2
    func GetSfsShareAccessRulesV2(ctx *Context, name string, id IDInput, state *SfsShareAccessRulesV2State, opts ...ResourceOption) (*SfsShareAccessRulesV2, error)
    public static SfsShareAccessRulesV2 Get(string name, Input<string> id, SfsShareAccessRulesV2State? state, CustomResourceOptions? opts = null)
    public static SfsShareAccessRulesV2 get(String name, Output<String> id, SfsShareAccessRulesV2State state, CustomResourceOptions options)
    resources:  _:    type: opentelekomcloud:SfsShareAccessRulesV2    get:      id: ${id}
    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:
    AccessRules List<SfsShareAccessRulesV2AccessRule>
    Specifies the access rules of SFS file share. Structure is documented below.
    SfsShareAccessRulesV2Id string
    ShareId string
    The UUID of the shared file system.
    AccessRules []SfsShareAccessRulesV2AccessRuleArgs
    Specifies the access rules of SFS file share. Structure is documented below.
    SfsShareAccessRulesV2Id string
    ShareId string
    The UUID of the shared file system.
    accessRules List<SfsShareAccessRulesV2AccessRule>
    Specifies the access rules of SFS file share. Structure is documented below.
    sfsShareAccessRulesV2Id String
    shareId String
    The UUID of the shared file system.
    accessRules SfsShareAccessRulesV2AccessRule[]
    Specifies the access rules of SFS file share. Structure is documented below.
    sfsShareAccessRulesV2Id string
    shareId string
    The UUID of the shared file system.
    access_rules Sequence[SfsShareAccessRulesV2AccessRuleArgs]
    Specifies the access rules of SFS file share. Structure is documented below.
    sfs_share_access_rules_v2_id str
    share_id str
    The UUID of the shared file system.
    accessRules List<Property Map>
    Specifies the access rules of SFS file share. Structure is documented below.
    sfsShareAccessRulesV2Id String
    shareId String
    The UUID of the shared file system.

    Supporting Types

    SfsShareAccessRulesV2AccessRule, SfsShareAccessRulesV2AccessRuleArgs

    AccessLevel string
    The access level of the shared file system. Possible values are ro (read-only) and rw (read-write). The default value is rw (read/write).
    AccessTo string
    The access that the back end grants or denies.
    AccessRuleStatus string
    The status of the share access rule.
    AccessType string
    The type of the share access rule. The value cert indicates that the certificate is used to access the storage.
    ShareAccessId string
    The UUID of the share access rule.
    AccessLevel string
    The access level of the shared file system. Possible values are ro (read-only) and rw (read-write). The default value is rw (read/write).
    AccessTo string
    The access that the back end grants or denies.
    AccessRuleStatus string
    The status of the share access rule.
    AccessType string
    The type of the share access rule. The value cert indicates that the certificate is used to access the storage.
    ShareAccessId string
    The UUID of the share access rule.
    accessLevel String
    The access level of the shared file system. Possible values are ro (read-only) and rw (read-write). The default value is rw (read/write).
    accessTo String
    The access that the back end grants or denies.
    accessRuleStatus String
    The status of the share access rule.
    accessType String
    The type of the share access rule. The value cert indicates that the certificate is used to access the storage.
    shareAccessId String
    The UUID of the share access rule.
    accessLevel string
    The access level of the shared file system. Possible values are ro (read-only) and rw (read-write). The default value is rw (read/write).
    accessTo string
    The access that the back end grants or denies.
    accessRuleStatus string
    The status of the share access rule.
    accessType string
    The type of the share access rule. The value cert indicates that the certificate is used to access the storage.
    shareAccessId string
    The UUID of the share access rule.
    access_level str
    The access level of the shared file system. Possible values are ro (read-only) and rw (read-write). The default value is rw (read/write).
    access_to str
    The access that the back end grants or denies.
    access_rule_status str
    The status of the share access rule.
    access_type str
    The type of the share access rule. The value cert indicates that the certificate is used to access the storage.
    share_access_id str
    The UUID of the share access rule.
    accessLevel String
    The access level of the shared file system. Possible values are ro (read-only) and rw (read-write). The default value is rw (read/write).
    accessTo String
    The access that the back end grants or denies.
    accessRuleStatus String
    The status of the share access rule.
    accessType String
    The type of the share access rule. The value cert indicates that the certificate is used to access the storage.
    shareAccessId String
    The UUID of the share access rule.

    Import

    SFS access rules can be imported using the id of the file share, e.g.

    $ pulumi import opentelekomcloud:index/sfsShareAccessRulesV2:SfsShareAccessRulesV2 opentelekomcloud_sfs_share_access_rules_v2 4779ab1c-7c1a-44b1-a02e-93dfc361b32d
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
    License
    Notes
    This Pulumi package is based on the opentelekomcloud Terraform Provider.
    opentelekomcloud logo
    opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud