opentelekomcloud.SfsShareAccessRulesV2
Explore with Pulumi AI
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:
- Access
Rules List<SfsShare Access Rules V2Access Rule> - Specifies the access rules of SFS file share. Structure is documented below.
- string
- The UUID of the shared file system.
- string
- Access
Rules []SfsShare Access Rules V2Access Rule Args - Specifies the access rules of SFS file share. Structure is documented below.
- string
- The UUID of the shared file system.
- string
- access
Rules List<SfsShare Access Rules V2Access Rule> - Specifies the access rules of SFS file share. Structure is documented below.
- String
- The UUID of the shared file system.
- String
- access
Rules SfsShare Access Rules V2Access Rule[] - Specifies the access rules of SFS file share. Structure is documented below.
- string
- The UUID of the shared file system.
- string
- access_
rules Sequence[SfsShare Access Rules V2Access Rule Args] - Specifies the access rules of SFS file share. Structure is documented below.
- str
- The UUID of the shared file system.
- str
- access
Rules List<Property Map> - Specifies the access rules of SFS file share. Structure is documented below.
- String
- The UUID of the shared file system.
- 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.
- Access
Rules List<SfsShare Access Rules V2Access Rule> - Specifies the access rules of SFS file share. Structure is documented below.
- string
- string
- The UUID of the shared file system.
- Access
Rules []SfsShare Access Rules V2Access Rule Args - Specifies the access rules of SFS file share. Structure is documented below.
- string
- string
- The UUID of the shared file system.
- access
Rules List<SfsShare Access Rules V2Access Rule> - Specifies the access rules of SFS file share. Structure is documented below.
- String
- String
- The UUID of the shared file system.
- access
Rules SfsShare Access Rules V2Access Rule[] - Specifies the access rules of SFS file share. Structure is documented below.
- string
- string
- The UUID of the shared file system.
- access_
rules Sequence[SfsShare Access Rules V2Access Rule Args] - Specifies the access rules of SFS file share. Structure is documented below.
- str
- str
- The UUID of the shared file system.
- access
Rules List<Property Map> - Specifies the access rules of SFS file share. Structure is documented below.
- String
- String
- The UUID of the shared file system.
Supporting Types
SfsShareAccessRulesV2AccessRule, SfsShareAccessRulesV2AccessRuleArgs
- Access
Level string - The access level of the shared file system. Possible values are
ro
(read-only) andrw
(read-write). The default value isrw
(read/write). - Access
To string - The access that the back end grants or denies.
- Access
Rule stringStatus - The status of the share access rule.
- Access
Type string - The type of the share access rule. The value
cert
indicates that the certificate is used to access the storage. - string
- The UUID of the share access rule.
- Access
Level string - The access level of the shared file system. Possible values are
ro
(read-only) andrw
(read-write). The default value isrw
(read/write). - Access
To string - The access that the back end grants or denies.
- Access
Rule stringStatus - The status of the share access rule.
- Access
Type string - The type of the share access rule. The value
cert
indicates that the certificate is used to access the storage. - string
- The UUID of the share access rule.
- access
Level String - The access level of the shared file system. Possible values are
ro
(read-only) andrw
(read-write). The default value isrw
(read/write). - access
To String - The access that the back end grants or denies.
- access
Rule StringStatus - The status of the share access rule.
- access
Type String - The type of the share access rule. The value
cert
indicates that the certificate is used to access the storage. - String
- The UUID of the share access rule.
- access
Level string - The access level of the shared file system. Possible values are
ro
(read-only) andrw
(read-write). The default value isrw
(read/write). - access
To string - The access that the back end grants or denies.
- access
Rule stringStatus - The status of the share access rule.
- access
Type string - The type of the share access rule. The value
cert
indicates that the certificate is used to access the storage. - 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) andrw
(read-write). The default value isrw
(read/write). - access_
to str - The access that the back end grants or denies.
- access_
rule_ strstatus - 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. - str
- The UUID of the share access rule.
- access
Level String - The access level of the shared file system. Possible values are
ro
(read-only) andrw
(read-write). The default value isrw
(read/write). - access
To String - The access that the back end grants or denies.
- access
Rule StringStatus - The status of the share access rule.
- access
Type String - The type of the share access rule. The value
cert
indicates that the certificate is used to access the storage. - 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.