UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

111 lines 5.39 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.ComputeImage = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Creates a virtual machine image resource for the Yandex Compute Cloud service from an existing * tarball. For more information, see [the official documentation](https://cloud.yandex.com/docs/compute/concepts/image). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const foo_image = new yandex.ComputeImage("foo-image", { * sourceUrl: "https://storage.yandexcloud.net/lucky-images/kube-it.img", * }); * const vm = new yandex.ComputeInstance("vm", { * bootDisk: { * initializeParams: { * imageId: foo_image.id, * }, * }, * }); * ``` * * ## Import * * A VM image can be imported using the `id` of the resource, e.g. * * ```sh * $ pulumi import yandex:index/computeImage:ComputeImage web-image image_id * ``` */ class ComputeImage extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["family"] = state ? state.family : undefined; resourceInputs["folderId"] = state ? state.folderId : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["minDiskSize"] = state ? state.minDiskSize : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["osType"] = state ? state.osType : undefined; resourceInputs["pooled"] = state ? state.pooled : undefined; resourceInputs["productIds"] = state ? state.productIds : undefined; resourceInputs["size"] = state ? state.size : undefined; resourceInputs["sourceDisk"] = state ? state.sourceDisk : undefined; resourceInputs["sourceFamily"] = state ? state.sourceFamily : undefined; resourceInputs["sourceImage"] = state ? state.sourceImage : undefined; resourceInputs["sourceSnapshot"] = state ? state.sourceSnapshot : undefined; resourceInputs["sourceUrl"] = state ? state.sourceUrl : undefined; resourceInputs["status"] = state ? state.status : undefined; } else { const args = argsOrState; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["family"] = args ? args.family : undefined; resourceInputs["folderId"] = args ? args.folderId : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["minDiskSize"] = args ? args.minDiskSize : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["osType"] = args ? args.osType : undefined; resourceInputs["pooled"] = args ? args.pooled : undefined; resourceInputs["productIds"] = args ? args.productIds : undefined; resourceInputs["sourceDisk"] = args ? args.sourceDisk : undefined; resourceInputs["sourceFamily"] = args ? args.sourceFamily : undefined; resourceInputs["sourceImage"] = args ? args.sourceImage : undefined; resourceInputs["sourceSnapshot"] = args ? args.sourceSnapshot : undefined; resourceInputs["sourceUrl"] = args ? args.sourceUrl : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["size"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ComputeImage.__pulumiType, name, resourceInputs, opts); } /** * Get an existing ComputeImage 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 ComputeImage(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ComputeImage. 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'] === ComputeImage.__pulumiType; } } exports.ComputeImage = ComputeImage; /** @internal */ ComputeImage.__pulumiType = 'yandex:index/computeImage:ComputeImage'; //# sourceMappingURL=computeImage.js.map