UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

155 lines 7.43 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.StudioInstance = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages DataArts Studio instance resource within HuaweiCloud. * * > Only **prePaid** charging mode is supported. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const availabilityZone = config.requireObject("availabilityZone"); * const vpcId = config.requireObject("vpcId"); * const subnetId = config.requireObject("subnetId"); * const secgroupId = config.requireObject("secgroupId"); * const myDemo = new huaweicloud.dataartsstudio.StudioInstance("myDemo", { * version: "dayu.starter", * vpcId: vpcId, * subnetId: subnetId, * securityGroupId: secgroupId, * availabilityZone: availabilityZone, * periodUnit: "month", * period: 1, * enterpriseProjectId: "0", * tags: { * key: "value", * }, * }); * ``` * * <!--markdownlint-disable MD033--> * * ## Import * * DataArts Studio instances can be imported using their `id`, e.g. * * ```sh * $ pulumi import huaweicloud:DataArtsStudio/studioInstance:StudioInstance instance e60361de2cfd42d7a6b673f0ae58db82 * ``` * * Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`tags`, `period_unit`, `period`, `auto_renew`. It is generally recommended running `terraform plan` after importing an instance. You can then decide if changes should be applied to the instance, or the resource definition should be updated to align with the instance. Also you can ignore changes as below. hcl resource "huaweicloud_dataarts_studio_instance" "instance" { * * ... * * lifecycle { * * ignore_changes = [ * * tags, period_unit, period, auto_renew, * * ] * * } } */ class StudioInstance extends pulumi.CustomResource { /** * Get an existing StudioInstance 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 StudioInstance(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of StudioInstance. 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'] === StudioInstance.__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["chargingMode"] = state ? state.chargingMode : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["expireDays"] = state ? state.expireDays : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["orderId"] = state ? state.orderId : 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["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.period === undefined) && !opts.urn) { throw new Error("Missing required property 'period'"); } if ((!args || args.periodUnit === undefined) && !opts.urn) { throw new Error("Missing required property 'periodUnit'"); } if ((!args || args.securityGroupId === undefined) && !opts.urn) { throw new Error("Missing required property 'securityGroupId'"); } if ((!args || args.subnetId === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } if ((!args || args.version === undefined) && !opts.urn) { throw new Error("Missing required property 'version'"); } 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["enterpriseProjectId"] = args ? args.enterpriseProjectId : 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["subnetId"] = args ? args.subnetId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["version"] = args ? args.version : undefined; resourceInputs["vpcId"] = args ? args.vpcId : undefined; resourceInputs["chargingMode"] = undefined /*out*/; resourceInputs["expireDays"] = undefined /*out*/; resourceInputs["orderId"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(StudioInstance.__pulumiType, name, resourceInputs, opts); } } exports.StudioInstance = StudioInstance; /** @internal */ StudioInstance.__pulumiType = 'huaweicloud:DataArtsStudio/studioInstance:StudioInstance'; //# sourceMappingURL=studioInstance.js.map