UNPKG

@upcloud/pulumi-upcloud

Version:

A Pulumi package for creating and managing UpCloud resources.

123 lines 5.62 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.KubernetesNodeGroup = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * This resource represents a [Managed Kubernetes](https://upcloud.com/products/managed-kubernetes) cluster. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as upcloud from "@upcloud/pulumi-upcloud"; * * // Create a network for the Kubernetes cluster * const example = new upcloud.Network("example", { * name: "example-network", * zone: "de-fra1", * ipNetwork: { * address: "172.16.1.0/24", * dhcp: true, * family: "IPv4", * }, * }); * // Create a Kubernetes cluster * const exampleKubernetesCluster = new upcloud.KubernetesCluster("example", { * controlPlaneIpFilters: ["0.0.0.0/0"], * name: "exampleapp", * network: example.id, * zone: "de-fra1", * }); * // Create a Kubernetes cluster node group * const group = new upcloud.KubernetesNodeGroup("group", { * cluster: upcloudKubernetesCluster.example.id, * nodeCount: 2, * name: "medium", * plan: "2xCPU-4GB", * labels: { * managedBy: "terraform", * }, * taints: [{ * effect: "NoExecute", * key: "taintKey", * value: "taintValue", * }], * }); * ``` */ class KubernetesNodeGroup extends pulumi.CustomResource { /** * Get an existing KubernetesNodeGroup 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 KubernetesNodeGroup(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of KubernetesNodeGroup. 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'] === KubernetesNodeGroup.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["antiAffinity"] = state ? state.antiAffinity : undefined; resourceInputs["cluster"] = state ? state.cluster : undefined; resourceInputs["customPlan"] = state ? state.customPlan : undefined; resourceInputs["kubeletArgs"] = state ? state.kubeletArgs : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nodeCount"] = state ? state.nodeCount : undefined; resourceInputs["plan"] = state ? state.plan : undefined; resourceInputs["sshKeys"] = state ? state.sshKeys : undefined; resourceInputs["storageEncryption"] = state ? state.storageEncryption : undefined; resourceInputs["taints"] = state ? state.taints : undefined; resourceInputs["utilityNetworkAccess"] = state ? state.utilityNetworkAccess : undefined; } else { const args = argsOrState; if ((!args || args.cluster === undefined) && !opts.urn) { throw new Error("Missing required property 'cluster'"); } if ((!args || args.nodeCount === undefined) && !opts.urn) { throw new Error("Missing required property 'nodeCount'"); } if ((!args || args.plan === undefined) && !opts.urn) { throw new Error("Missing required property 'plan'"); } resourceInputs["antiAffinity"] = args ? args.antiAffinity : undefined; resourceInputs["cluster"] = args ? args.cluster : undefined; resourceInputs["customPlan"] = args ? args.customPlan : undefined; resourceInputs["kubeletArgs"] = args ? args.kubeletArgs : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["nodeCount"] = args ? args.nodeCount : undefined; resourceInputs["plan"] = args ? args.plan : undefined; resourceInputs["sshKeys"] = args ? args.sshKeys : undefined; resourceInputs["storageEncryption"] = args ? args.storageEncryption : undefined; resourceInputs["taints"] = args ? args.taints : undefined; resourceInputs["utilityNetworkAccess"] = args ? args.utilityNetworkAccess : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(KubernetesNodeGroup.__pulumiType, name, resourceInputs, opts); } } exports.KubernetesNodeGroup = KubernetesNodeGroup; /** @internal */ KubernetesNodeGroup.__pulumiType = 'upcloud:index/kubernetesNodeGroup:KubernetesNodeGroup'; //# sourceMappingURL=kubernetesNodeGroup.js.map