UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

104 lines 5.1 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.NodePoolScale = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Use this resource to scale the CCE node pool within HuaweiCloud. * * ## Example Usage * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const clusterId = config.requireObject("clusterId"); * const nodepoolId = config.requireObject("nodepoolId"); * const test = new huaweicloud.cce.NodePoolScale("test", { * clusterId: clusterId, * nodepoolId: nodepoolId, * scaleGroups: ["default"], * desiredNodeCount: 2, * }); * ``` * * > Deleting node pool scale is not supported, it will only be removed from the state. */ class NodePoolScale extends pulumi.CustomResource { /** * Get an existing NodePoolScale 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 NodePoolScale(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of NodePoolScale. 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'] === NodePoolScale.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["autoRenew"] = state ? state.autoRenew : undefined; resourceInputs["chargingMode"] = state ? state.chargingMode : undefined; resourceInputs["clusterId"] = state ? state.clusterId : undefined; resourceInputs["desiredNodeCount"] = state ? state.desiredNodeCount : undefined; resourceInputs["enableForceNew"] = state ? state.enableForceNew : undefined; resourceInputs["nodepoolId"] = state ? state.nodepoolId : undefined; resourceInputs["period"] = state ? state.period : undefined; resourceInputs["periodUnit"] = state ? state.periodUnit : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["scalableChecking"] = state ? state.scalableChecking : undefined; resourceInputs["scaleGroups"] = state ? state.scaleGroups : undefined; } else { const args = argsOrState; if ((!args || args.clusterId === undefined) && !opts.urn) { throw new Error("Missing required property 'clusterId'"); } if ((!args || args.desiredNodeCount === undefined) && !opts.urn) { throw new Error("Missing required property 'desiredNodeCount'"); } if ((!args || args.nodepoolId === undefined) && !opts.urn) { throw new Error("Missing required property 'nodepoolId'"); } if ((!args || args.scaleGroups === undefined) && !opts.urn) { throw new Error("Missing required property 'scaleGroups'"); } resourceInputs["autoRenew"] = args ? args.autoRenew : undefined; resourceInputs["chargingMode"] = args ? args.chargingMode : undefined; resourceInputs["clusterId"] = args ? args.clusterId : undefined; resourceInputs["desiredNodeCount"] = args ? args.desiredNodeCount : undefined; resourceInputs["enableForceNew"] = args ? args.enableForceNew : undefined; resourceInputs["nodepoolId"] = args ? args.nodepoolId : undefined; resourceInputs["period"] = args ? args.period : undefined; resourceInputs["periodUnit"] = args ? args.periodUnit : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["scalableChecking"] = args ? args.scalableChecking : undefined; resourceInputs["scaleGroups"] = args ? args.scaleGroups : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(NodePoolScale.__pulumiType, name, resourceInputs, opts); } } exports.NodePoolScale = NodePoolScale; /** @internal */ NodePoolScale.__pulumiType = 'huaweicloud:Cce/nodePoolScale:NodePoolScale'; //# sourceMappingURL=nodePoolScale.js.map