UNPKG

@ediri/vultr

Version:

A Pulumi package for creating and managing Vultr cloud resources.

146 lines 6.3 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.KubernetesNodePools = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Deploy additional node pools to an existing Vultr Kubernetes Engine (VKE) cluster. * * ## Example Usage * * Create a new VKE cluster: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vultr from "@ediri/vultr"; * * const np_1 = new vultr.KubernetesNodePools("np-1", { * clusterId: vultr_kubernetes.k8.id, * nodeQuantity: 1, * plan: "vc2-4c-8gb", * label: "my-label", * tag: "my-tag", * autoScaler: true, * minNodes: 1, * maxNodes: 2, * labels: { * "my-label": "a-label-on-all-nodes", * "my-second-label": "another-label-on-all-nodes", * }, * taints: [ * { * key: "a-taint", * value: "is-tainted", * effect: "NoExecute", * }, * { * key: "another-taint", * value: "is-tainted", * effect: "NoSchedule", * }, * ], * }); * ``` * * ## Import * * Node pool resources are able to be imported into terraform state like other * * resources, however, since they rely on a kubernetes cluster, the import state * * requires the UUID of the cluster as well. With that in mind, format the second * * argument to the `pulumi import` command as a space delimited string of * * UUIDs, the first is the cluster ID, the second is the node pool ID. It will * * look like this: * * "clusterID nodePoolID" * * ```sh * $ pulumi import vultr:index/kubernetesNodePools:KubernetesNodePools my-k8s-np "7365a98b-5a43-450f-bd27-d768827100e5 ec330340-4f50-4526-858f-a39199f568ac" * ``` */ class KubernetesNodePools extends pulumi.CustomResource { /** * Get an existing KubernetesNodePools 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 KubernetesNodePools(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of KubernetesNodePools. 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'] === KubernetesNodePools.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["autoScaler"] = state ? state.autoScaler : undefined; resourceInputs["clusterId"] = state ? state.clusterId : undefined; resourceInputs["dateCreated"] = state ? state.dateCreated : undefined; resourceInputs["dateUpdated"] = state ? state.dateUpdated : undefined; resourceInputs["label"] = state ? state.label : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["maxNodes"] = state ? state.maxNodes : undefined; resourceInputs["minNodes"] = state ? state.minNodes : undefined; resourceInputs["nodeQuantity"] = state ? state.nodeQuantity : undefined; resourceInputs["nodes"] = state ? state.nodes : undefined; resourceInputs["plan"] = state ? state.plan : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tag"] = state ? state.tag : undefined; resourceInputs["taints"] = state ? state.taints : undefined; } else { const args = argsOrState; if ((!args || args.clusterId === undefined) && !opts.urn) { throw new Error("Missing required property 'clusterId'"); } if ((!args || args.label === undefined) && !opts.urn) { throw new Error("Missing required property 'label'"); } if ((!args || args.nodeQuantity === undefined) && !opts.urn) { throw new Error("Missing required property 'nodeQuantity'"); } if ((!args || args.plan === undefined) && !opts.urn) { throw new Error("Missing required property 'plan'"); } resourceInputs["autoScaler"] = args ? args.autoScaler : undefined; resourceInputs["clusterId"] = args ? args.clusterId : undefined; resourceInputs["label"] = args ? args.label : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["maxNodes"] = args ? args.maxNodes : undefined; resourceInputs["minNodes"] = args ? args.minNodes : undefined; resourceInputs["nodeQuantity"] = args ? args.nodeQuantity : undefined; resourceInputs["plan"] = args ? args.plan : undefined; resourceInputs["tag"] = args ? args.tag : undefined; resourceInputs["taints"] = args ? args.taints : undefined; resourceInputs["dateCreated"] = undefined /*out*/; resourceInputs["dateUpdated"] = undefined /*out*/; resourceInputs["nodes"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(KubernetesNodePools.__pulumiType, name, resourceInputs, opts); } } exports.KubernetesNodePools = KubernetesNodePools; /** @internal */ KubernetesNodePools.__pulumiType = 'vultr:index/kubernetesNodePools:KubernetesNodePools'; //# sourceMappingURL=kubernetesNodePools.js.map