@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
132 lines • 5.37 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.MountPoint = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage nas mount point
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooZones = volcengine.nas.getZones({});
* const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
* vpcName: "acc-test-project1",
* cidrBlock: "172.16.0.0/16",
* });
* const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
* subnetName: "acc-subnet-test-2",
* cidrBlock: "172.16.0.0/24",
* zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* vpcId: fooVpc.id,
* });
* const fooPermissionGroup = new volcengine.nas.PermissionGroup("fooPermissionGroup", {
* permissionGroupName: "acc-test",
* description: "acctest",
* permissionRules: [
* {
* cidrIp: "*",
* rwMode: "RW",
* useMode: "All_squash",
* },
* {
* cidrIp: "192.168.0.0",
* rwMode: "RO",
* useMode: "All_squash",
* },
* ],
* });
* const fooFileSystem = new volcengine.nas.FileSystem("fooFileSystem", {
* fileSystemName: "acc-test-fs",
* description: "acc-test",
* zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* capacity: 103,
* projectName: "default",
* tags: [{
* key: "k1",
* value: "v1",
* }],
* });
* const fooMountPoint = new volcengine.nas.MountPoint("fooMountPoint", {
* fileSystemId: fooFileSystem.id,
* mountPointName: "acc-test",
* permissionGroupId: fooPermissionGroup.id,
* subnetId: fooSubnet.id,
* });
* ```
*
* ## Import
*
* Nas Mount Point can be imported using the file system id and mount point id, e.g.
*
* ```sh
* $ pulumi import volcengine:nas/mountPoint:MountPoint default enas-cnbj18bcb923****:mount-a6ee****
* ```
*/
class MountPoint extends pulumi.CustomResource {
/**
* Get an existing MountPoint resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new MountPoint(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MountPoint. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === MountPoint.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["fileSystemId"] = state ? state.fileSystemId : undefined;
resourceInputs["mountPointId"] = state ? state.mountPointId : undefined;
resourceInputs["mountPointName"] = state ? state.mountPointName : undefined;
resourceInputs["permissionGroupId"] = state ? state.permissionGroupId : undefined;
resourceInputs["subnetId"] = state ? state.subnetId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.fileSystemId === undefined) && !opts.urn) {
throw new Error("Missing required property 'fileSystemId'");
}
if ((!args || args.mountPointName === undefined) && !opts.urn) {
throw new Error("Missing required property 'mountPointName'");
}
if ((!args || args.permissionGroupId === undefined) && !opts.urn) {
throw new Error("Missing required property 'permissionGroupId'");
}
if ((!args || args.subnetId === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetId'");
}
resourceInputs["fileSystemId"] = args ? args.fileSystemId : undefined;
resourceInputs["mountPointName"] = args ? args.mountPointName : undefined;
resourceInputs["permissionGroupId"] = args ? args.permissionGroupId : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["mountPointId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MountPoint.__pulumiType, name, resourceInputs, opts);
}
}
exports.MountPoint = MountPoint;
/** @internal */
MountPoint.__pulumiType = 'volcengine:nas/mountPoint:MountPoint';
//# sourceMappingURL=mountPoint.js.map