UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

163 lines 7.81 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.ComputeInstanceGroup = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * An Instance group resource. For more information, see * [the official documentation](https://cloud.yandex.com/docs/compute/concepts/instance-groups/). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as fs from "fs"; * import * as yandex from "@pulumi/yandex"; * * const group1 = new yandex.ComputeInstanceGroup("group1", { * allocationPolicy: { * zones: ["ru-central1-a"], * }, * deletionProtection: true, * deployPolicy: { * maxCreating: 2, * maxDeleting: 2, * maxExpansion: 2, * maxUnavailable: 2, * }, * folderId: yandex_resourcemanager_folder_test_folder.id, * instanceTemplate: { * bootDisk: { * initializeParams: { * imageId: yandex_compute_image_ubuntu.id, * size: 4, * }, * mode: "READ_WRITE", * }, * labels: { * label1: "label1-value", * label2: "label2-value", * }, * metadata: { * foo: "bar", * "ssh-keys": `ubuntu:${fs.readFileSync("~/.ssh/id_rsa.pub", "utf-8")}`, * }, * networkInterfaces: [{ * networkId: yandex_vpc_network_my_inst_group_network.id, * subnetIds: [yandex_vpc_subnet_my_inst_group_subnet.id], * }], * networkSettings: [{ * type: "STANDARD", * }], * platformId: "standard-v1", * resources: { * cores: 2, * memory: 1, * }, * }, * scalePolicy: { * fixedScale: { * size: 3, * }, * }, * serviceAccountId: yandex_iam_service_account_test_account.id, * variables: { * test_key1: "test_value1", * test_key2: "test_value2", * }, * }); * ``` */ class ComputeInstanceGroup extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allocationPolicy"] = state ? state.allocationPolicy : undefined; resourceInputs["applicationLoadBalancer"] = state ? state.applicationLoadBalancer : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["deletionProtection"] = state ? state.deletionProtection : undefined; resourceInputs["deployPolicy"] = state ? state.deployPolicy : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["folderId"] = state ? state.folderId : undefined; resourceInputs["healthChecks"] = state ? state.healthChecks : undefined; resourceInputs["instanceTemplate"] = state ? state.instanceTemplate : undefined; resourceInputs["instances"] = state ? state.instances : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["loadBalancer"] = state ? state.loadBalancer : undefined; resourceInputs["maxCheckingHealthDuration"] = state ? state.maxCheckingHealthDuration : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["scalePolicy"] = state ? state.scalePolicy : undefined; resourceInputs["serviceAccountId"] = state ? state.serviceAccountId : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["variables"] = state ? state.variables : undefined; } else { const args = argsOrState; if ((!args || args.allocationPolicy === undefined) && !opts.urn) { throw new Error("Missing required property 'allocationPolicy'"); } if ((!args || args.deployPolicy === undefined) && !opts.urn) { throw new Error("Missing required property 'deployPolicy'"); } 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'"); } if ((!args || args.serviceAccountId === undefined) && !opts.urn) { throw new Error("Missing required property 'serviceAccountId'"); } resourceInputs["allocationPolicy"] = args ? args.allocationPolicy : undefined; resourceInputs["applicationLoadBalancer"] = args ? args.applicationLoadBalancer : undefined; resourceInputs["deletionProtection"] = args ? args.deletionProtection : undefined; resourceInputs["deployPolicy"] = args ? args.deployPolicy : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["folderId"] = args ? args.folderId : undefined; resourceInputs["healthChecks"] = args ? args.healthChecks : undefined; resourceInputs["instanceTemplate"] = args ? args.instanceTemplate : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["loadBalancer"] = args ? args.loadBalancer : undefined; resourceInputs["maxCheckingHealthDuration"] = args ? args.maxCheckingHealthDuration : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["scalePolicy"] = args ? args.scalePolicy : undefined; resourceInputs["serviceAccountId"] = args ? args.serviceAccountId : undefined; resourceInputs["variables"] = args ? args.variables : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["instances"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ComputeInstanceGroup.__pulumiType, name, resourceInputs, opts); } /** * Get an existing ComputeInstanceGroup 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 ComputeInstanceGroup(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ComputeInstanceGroup. 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'] === ComputeInstanceGroup.__pulumiType; } } exports.ComputeInstanceGroup = ComputeInstanceGroup; /** @internal */ ComputeInstanceGroup.__pulumiType = 'yandex:index/computeInstanceGroup:ComputeInstanceGroup'; //# sourceMappingURL=computeInstanceGroup.js.map