UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

164 lines 7.14 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"); /** * Creates a Yandex Kubernetes Node Group. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const myNodeGroup = new yandex.KubernetesNodeGroup("my_node_group", { * allocationPolicy: { * locations: [{ * zone: "ru-central1-a", * }], * }, * clusterId: yandex_kubernetes_cluster_my_cluster.id, * description: "description", * instanceTemplate: { * bootDisk: { * size: 64, * type: "network-hdd", * }, * containerRuntime: { * type: "containerd", * }, * networkInterfaces: [{ * nat: true, * subnetIds: [yandex_vpc_subnet_my_subnet.id], * }], * platformId: "standard-v2", * resources: { * cores: 2, * memory: 2, * }, * schedulingPolicy: { * preemptible: false, * }, * }, * labels: { * key: "value", * }, * maintenancePolicy: { * autoRepair: true, * autoUpgrade: true, * maintenanceWindows: [ * { * day: "monday", * duration: "3h", * startTime: "15:00", * }, * { * day: "friday", * duration: "4h30m", * startTime: "10:00", * }, * ], * }, * scalePolicy: { * fixedScale: { * size: 1, * }, * }, * version: "1.17", * }); * ``` * * ## Import * * A Yandex Kubernetes Node Group can be imported using the `id` of the resource, e.g. * * ```sh * $ pulumi import yandex:index/kubernetesNodeGroup:KubernetesNodeGroup default node_group_id * ``` */ class KubernetesNodeGroup extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allocationPolicy"] = state ? state.allocationPolicy : undefined; resourceInputs["allowedUnsafeSysctls"] = state ? state.allowedUnsafeSysctls : undefined; resourceInputs["clusterId"] = state ? state.clusterId : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["deployPolicy"] = state ? state.deployPolicy : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["instanceGroupId"] = state ? state.instanceGroupId : undefined; resourceInputs["instanceTemplate"] = state ? state.instanceTemplate : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["maintenancePolicy"] = state ? state.maintenancePolicy : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nodeLabels"] = state ? state.nodeLabels : undefined; resourceInputs["nodeTaints"] = state ? state.nodeTaints : undefined; resourceInputs["scalePolicy"] = state ? state.scalePolicy : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["version"] = state ? state.version : undefined; resourceInputs["versionInfos"] = state ? state.versionInfos : undefined; } else { const args = argsOrState; if ((!args || args.clusterId === undefined) && !opts.urn) { throw new Error("Missing required property 'clusterId'"); } if ((!args || args.instanceTemplate === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceTemplate'"); } if ((!args || args.scalePolicy === undefined) && !opts.urn) { throw new Error("Missing required property 'scalePolicy'"); } resourceInputs["allocationPolicy"] = args ? args.allocationPolicy : undefined; resourceInputs["allowedUnsafeSysctls"] = args ? args.allowedUnsafeSysctls : undefined; resourceInputs["clusterId"] = args ? args.clusterId : undefined; resourceInputs["deployPolicy"] = args ? args.deployPolicy : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["instanceTemplate"] = args ? args.instanceTemplate : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["maintenancePolicy"] = args ? args.maintenancePolicy : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["nodeLabels"] = args ? args.nodeLabels : undefined; resourceInputs["nodeTaints"] = args ? args.nodeTaints : undefined; resourceInputs["scalePolicy"] = args ? args.scalePolicy : undefined; resourceInputs["version"] = args ? args.version : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["instanceGroupId"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["versionInfos"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(KubernetesNodeGroup.__pulumiType, name, resourceInputs, opts); } /** * 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; } } exports.KubernetesNodeGroup = KubernetesNodeGroup; /** @internal */ KubernetesNodeGroup.__pulumiType = 'yandex:index/kubernetesNodeGroup:KubernetesNodeGroup'; //# sourceMappingURL=kubernetesNodeGroup.js.map