@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
209 lines • 9.7 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.Turbo = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a SFS Turbo resource within HuaweiCloud.
*
* ## Example Usage
* ### Create a STANDARD Shared File System (SFS) Turbo
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const vpcId = config.requireObject("vpcId");
* const subnetId = config.requireObject("subnetId");
* const secgroupId = config.requireObject("secgroupId");
* const testAz = config.requireObject("testAz");
* const test = new huaweicloud.sfs.Turbo("test", {
* size: 500,
* shareProto: "NFS",
* vpcId: vpcId,
* subnetId: subnetId,
* securityGroupId: secgroupId,
* availabilityZone: testAz,
* tags: {
* foo: "bar",
* key: "value",
* },
* });
* ```
* ### Create an HPC Shared File System (SFS) Turbo
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const vpcId = config.requireObject("vpcId");
* const subnetId = config.requireObject("subnetId");
* const secgroupId = config.requireObject("secgroupId");
* const testAz = config.requireObject("testAz");
* const test = new huaweicloud.sfs.Turbo("test", {
* size: 3686,
* shareProto: "NFS",
* shareType: "HPC",
* hpcBandwidth: "40M",
* vpcId: vpcId,
* subnetId: subnetId,
* securityGroupId: secgroupId,
* availabilityZone: testAz,
* });
* ```
* ### Create an HPC CACHE Shared File System (SFS) Turbo
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const vpcId = config.requireObject("vpcId");
* const subnetId = config.requireObject("subnetId");
* const secgroupId = config.requireObject("secgroupId");
* const testAz = config.requireObject("testAz");
* const test = new huaweicloud.sfs.Turbo("test", {
* size: 4096,
* shareProto: "NFS",
* shareType: "HPC_CACHE",
* hpcCacheBandwidth: "2G",
* vpcId: vpcId,
* subnetId: subnetId,
* securityGroupId: secgroupId,
* availabilityZone: testAz,
* });
* ```
*
* ## Import
*
* The resource can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Sfs/turbo:Turbo test <id>
* ```
*
* Note that the imported state may not be identical to your resource definition, due to payment attributes missing from the API response. The missing attributes include`charging_mode`, `period_unit`, `period`, `auto_renew`. It is generally recommended running `terraform plan` after importing an instance. You can ignore changes as below. hcl resource "huaweicloud_sfs_turbo" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* charging_mode, period_unit, period, auto_renew,
*
* ]
*
* } }
*/
class Turbo extends pulumi.CustomResource {
/**
* Get an existing Turbo 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 Turbo(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Turbo. 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'] === Turbo.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["autoRenew"] = state ? state.autoRenew : undefined;
resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined;
resourceInputs["availableCapacity"] = state ? state.availableCapacity : undefined;
resourceInputs["backupId"] = state ? state.backupId : undefined;
resourceInputs["chargingMode"] = state ? state.chargingMode : undefined;
resourceInputs["cryptKeyId"] = state ? state.cryptKeyId : undefined;
resourceInputs["dedicatedFlavor"] = state ? state.dedicatedFlavor : undefined;
resourceInputs["dedicatedStorageId"] = state ? state.dedicatedStorageId : undefined;
resourceInputs["enhanced"] = state ? state.enhanced : undefined;
resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined;
resourceInputs["exportLocation"] = state ? state.exportLocation : undefined;
resourceInputs["hpcBandwidth"] = state ? state.hpcBandwidth : undefined;
resourceInputs["hpcCacheBandwidth"] = state ? state.hpcCacheBandwidth : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["period"] = state ? state.period : undefined;
resourceInputs["periodUnit"] = state ? state.periodUnit : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["securityGroupId"] = state ? state.securityGroupId : undefined;
resourceInputs["shareProto"] = state ? state.shareProto : undefined;
resourceInputs["shareType"] = state ? state.shareType : undefined;
resourceInputs["size"] = state ? state.size : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["subnetId"] = state ? state.subnetId : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["version"] = state ? state.version : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.availabilityZone === undefined) && !opts.urn) {
throw new Error("Missing required property 'availabilityZone'");
}
if ((!args || args.securityGroupId === undefined) && !opts.urn) {
throw new Error("Missing required property 'securityGroupId'");
}
if ((!args || args.size === undefined) && !opts.urn) {
throw new Error("Missing required property 'size'");
}
if ((!args || args.subnetId === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetId'");
}
if ((!args || args.vpcId === undefined) && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
resourceInputs["autoRenew"] = args ? args.autoRenew : undefined;
resourceInputs["availabilityZone"] = args ? args.availabilityZone : undefined;
resourceInputs["backupId"] = args ? args.backupId : undefined;
resourceInputs["chargingMode"] = args ? args.chargingMode : undefined;
resourceInputs["cryptKeyId"] = args ? args.cryptKeyId : undefined;
resourceInputs["dedicatedFlavor"] = args ? args.dedicatedFlavor : undefined;
resourceInputs["dedicatedStorageId"] = args ? args.dedicatedStorageId : undefined;
resourceInputs["enhanced"] = args ? args.enhanced : undefined;
resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined;
resourceInputs["hpcBandwidth"] = args ? args.hpcBandwidth : undefined;
resourceInputs["hpcCacheBandwidth"] = args ? args.hpcCacheBandwidth : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["period"] = args ? args.period : undefined;
resourceInputs["periodUnit"] = args ? args.periodUnit : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["securityGroupId"] = args ? args.securityGroupId : undefined;
resourceInputs["shareProto"] = args ? args.shareProto : undefined;
resourceInputs["shareType"] = args ? args.shareType : undefined;
resourceInputs["size"] = args ? args.size : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["vpcId"] = args ? args.vpcId : undefined;
resourceInputs["availableCapacity"] = undefined /*out*/;
resourceInputs["exportLocation"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Turbo.__pulumiType, name, resourceInputs, opts);
}
}
exports.Turbo = Turbo;
/** @internal */
Turbo.__pulumiType = 'huaweicloud:Sfs/turbo:Turbo';
//# sourceMappingURL=turbo.js.map