UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

169 lines 7.41 kB
"use strict"; // *** 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"); /** * !> **WARNING:** It has been deprecated. * * Provides a Shared File System (SFS) resource within HuaweiCloud. * * ## Example Usage * ### Basic example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const shareName = config.requireObject("shareName"); * const shareDescription = config.requireObject("shareDescription"); * const vpcId = config.requireObject("vpcId"); * const share_file = new huaweicloud.sfs.FileSystem("share-file", { * size: 100, * shareProto: "NFS", * accessLevel: "rw", * accessTo: vpcId, * description: shareDescription, * tags: { * key: "value", * }, * }); * ``` * ### SFS with data encryption * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const shareName = config.requireObject("shareName"); * const shareDescription = config.requireObject("shareDescription"); * const vpcId = config.requireObject("vpcId"); * const share_file = new huaweicloud.sfs.FileSystem("share-file", { * size: 100, * shareProto: "NFS", * accessLevel: "rw", * accessTo: vpcId, * description: shareDescription, * metadata: { * "#sfs_crypt_key_id": huaweicloud_kms_key.mykey.id, * "#sfs_crypt_domain_id": huaweicloud_kms_key.mykey.domain_id, * "#sfs_crypt_alias": huaweicloud_kms_key.mykey.key_alias, * }, * tags: { * "function": "encryption", * }, * }); * ``` * ### SFS with Auto Capacity Expansion * * > This feature is only supported in specific regions. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const shareName = config.requireObject("shareName"); * const share_file = new huaweicloud.sfs.FileSystem("share-file", { * size: 100, * shareProto: "NFS", * description: "auto capacity expansion", * metadata: { * "#sfs_quota_type": "soft", * }, * }); * ``` * * ## Import * * SFS can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Sfs/fileSystem:FileSystem huaweicloud_sfs_file_system 4779ab1c-7c1a-44b1-a02e-93dfc361b32d * ``` * * [huaweicloud_sfs_access_rule](https://registry.terraform.io/providers/huaweicloud/huaweicloud/latest/docs/resources/sfs_access_rule). */ 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["accessLevel"] = state ? state.accessLevel : undefined; resourceInputs["accessRuleStatus"] = state ? state.accessRuleStatus : undefined; resourceInputs["accessRules"] = state ? state.accessRules : undefined; resourceInputs["accessTo"] = state ? state.accessTo : undefined; resourceInputs["accessType"] = state ? state.accessType : undefined; resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["exportLocation"] = state ? state.exportLocation : undefined; resourceInputs["isPublic"] = state ? state.isPublic : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["shareAccessId"] = state ? state.shareAccessId : undefined; resourceInputs["shareProto"] = state ? state.shareProto : undefined; resourceInputs["size"] = state ? state.size : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tags"] = state ? state.tags : undefined; } else { const args = argsOrState; if ((!args || args.size === undefined) && !opts.urn) { throw new Error("Missing required property 'size'"); } resourceInputs["accessLevel"] = args ? args.accessLevel : undefined; resourceInputs["accessTo"] = args ? args.accessTo : undefined; resourceInputs["accessType"] = args ? args.accessType : undefined; resourceInputs["availabilityZone"] = args ? args.availabilityZone : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["isPublic"] = args ? args.isPublic : undefined; resourceInputs["metadata"] = args ? args.metadata : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["shareProto"] = args ? args.shareProto : undefined; resourceInputs["size"] = args ? args.size : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["accessRuleStatus"] = undefined /*out*/; resourceInputs["accessRules"] = undefined /*out*/; resourceInputs["exportLocation"] = undefined /*out*/; resourceInputs["shareAccessId"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FileSystem.__pulumiType, name, resourceInputs, opts); } } exports.FileSystem = FileSystem; /** @internal */ FileSystem.__pulumiType = 'huaweicloud:Sfs/fileSystem:FileSystem'; //# sourceMappingURL=fileSystem.js.map