UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

118 lines 5.55 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.Bandwidth = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a **Shared** Bandwidth resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const bandwidth1 = new huaweicloud.Vpc.Bandwidth("bandwidth_1", { * size: 5, * }); * ``` * * ## Import * * Shared Bandwidths can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Vpc/bandwidth:Bandwidth bandwidth_1 7117d38e-4c8f-4624-a505-bd96b97d024c * ``` * * 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`period_unit`, `period`, `auto_renew`. It is generally recommended running `terraform plan` after importing a Shared Bandwidth. You can ignore changes as below. hcl resource "huaweicloud_vpc_bandwidth" "bandwidth_1" { * * ... * * lifecycle { * * ignore_changes = [ * * period_unit, period, auto_renew, * * ] * * } } */ class Bandwidth extends pulumi.CustomResource { /** * Get an existing Bandwidth 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 Bandwidth(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Bandwidth. 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'] === Bandwidth.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["autoRenew"] = state ? state.autoRenew : undefined; resourceInputs["bandwidthType"] = state ? state.bandwidthType : undefined; resourceInputs["chargeMode"] = state ? state.chargeMode : undefined; resourceInputs["chargingMode"] = state ? state.chargingMode : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["period"] = state ? state.period : undefined; resourceInputs["periodUnit"] = state ? state.periodUnit : undefined; resourceInputs["publicBorderGroup"] = state ? state.publicBorderGroup : undefined; resourceInputs["publicips"] = state ? state.publicips : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["shareType"] = state ? state.shareType : undefined; resourceInputs["size"] = state ? state.size : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; } else { const args = argsOrState; if ((!args || args.size === undefined) && !opts.urn) { throw new Error("Missing required property 'size'"); } resourceInputs["autoRenew"] = args ? args.autoRenew : undefined; resourceInputs["bandwidthType"] = args ? args.bandwidthType : undefined; resourceInputs["chargeMode"] = args ? args.chargeMode : undefined; resourceInputs["chargingMode"] = args ? args.chargingMode : 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["publicBorderGroup"] = args ? args.publicBorderGroup : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["size"] = args ? args.size : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["publicips"] = undefined /*out*/; resourceInputs["shareType"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Bandwidth.__pulumiType, name, resourceInputs, opts); } } exports.Bandwidth = Bandwidth; /** @internal */ Bandwidth.__pulumiType = 'huaweicloud:Vpc/bandwidth:Bandwidth'; //# sourceMappingURL=bandwidth.js.map