@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
160 lines • 7.09 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.FileSystem = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage nas file system
* ## 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({});
* // create nas file system
* 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",
* }],
* });
* // create vpc
* const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
* vpcName: "acc-test-vpc",
* cidrBlock: "172.16.0.0/16",
* });
* // create subnet
* const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
* subnetName: "acc-test-subnet",
* cidrBlock: "172.16.0.0/24",
* zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* vpcId: fooVpc.id,
* });
* // create nas permission group
* 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",
* },
* ],
* });
* // create nas mount point
* const fooMountPoint = new volcengine.nas.MountPoint("fooMountPoint", {
* fileSystemId: fooFileSystem.id,
* mountPointName: "acc-test",
* permissionGroupId: fooPermissionGroup.id,
* subnetId: fooSubnet.id,
* });
* ```
*
* ## Import
*
* NasFileSystem can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:nas/fileSystem:FileSystem default enas-cnbjd3879745****
* ```
*/
class FileSystem extends pulumi.CustomResource {
/**
* Get an existing FileSystem 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 FileSystem(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FileSystem. 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'] === FileSystem.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["capacity"] = state ? state.capacity : undefined;
resourceInputs["chargeType"] = state ? state.chargeType : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["fileSystemName"] = state ? state.fileSystemName : undefined;
resourceInputs["fileSystemType"] = state ? state.fileSystemType : undefined;
resourceInputs["projectName"] = state ? state.projectName : undefined;
resourceInputs["protocolType"] = state ? state.protocolType : undefined;
resourceInputs["regionId"] = state ? state.regionId : undefined;
resourceInputs["snapshotCount"] = state ? state.snapshotCount : undefined;
resourceInputs["snapshotId"] = state ? state.snapshotId : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["storageType"] = state ? state.storageType : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
resourceInputs["version"] = state ? state.version : undefined;
resourceInputs["zoneId"] = state ? state.zoneId : undefined;
resourceInputs["zoneName"] = state ? state.zoneName : undefined;
}
else {
const args = argsOrState;
if ((!args || args.capacity === undefined) && !opts.urn) {
throw new Error("Missing required property 'capacity'");
}
if ((!args || args.fileSystemName === undefined) && !opts.urn) {
throw new Error("Missing required property 'fileSystemName'");
}
if ((!args || args.zoneId === undefined) && !opts.urn) {
throw new Error("Missing required property 'zoneId'");
}
resourceInputs["capacity"] = args ? args.capacity : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["fileSystemName"] = args ? args.fileSystemName : undefined;
resourceInputs["projectName"] = args ? args.projectName : undefined;
resourceInputs["snapshotId"] = args ? args.snapshotId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["zoneId"] = args ? args.zoneId : undefined;
resourceInputs["chargeType"] = undefined /*out*/;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["fileSystemType"] = undefined /*out*/;
resourceInputs["protocolType"] = undefined /*out*/;
resourceInputs["regionId"] = undefined /*out*/;
resourceInputs["snapshotCount"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["storageType"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
resourceInputs["zoneName"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FileSystem.__pulumiType, name, resourceInputs, opts);
}
}
exports.FileSystem = FileSystem;
/** @internal */
FileSystem.__pulumiType = 'volcengine:nas/fileSystem:FileSystem';
//# sourceMappingURL=fileSystem.js.map