UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

130 lines 5.87 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.ComputeDisk = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Persistent disks are used for data storage and function similarly to physical hard and solid state drives. * * A disk can be attached or detached from the virtual machine and can be located locally. A disk can be moved between virtual machines within the same availability zone. Each disk can be attached to only one virtual machine at a time. * * For more information about disks in Yandex.Cloud, see: * * * [Documentation](https://cloud.yandex.com/docs/compute/concepts/disk) * * How-to Guides * * [Attach and detach a disk](https://cloud.yandex.com/docs/compute/concepts/disk#attach-detach) * * [Backup operation](https://cloud.yandex.com/docs/compute/concepts/disk#backup) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const defaultComputeDisk = new yandex.ComputeDisk("default", { * imageId: "ubuntu-16.04-v20180727", * labels: { * environment: "test", * }, * type: "network-ssd", * zone: "ru-central1-a", * }); * ``` * ### Non-Replicated Disk * * **Note**: Non-replicated disks are at the [Preview](https://cloud.yandex.com/docs/overview/concepts/launch-stages) * stage. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const _this = new yandex.ComputeDiskPlacementGroup("this", {zone: "ru-central1-b"}); * const nr = new yandex.ComputeDisk("nr", { * size: 93, * type: "network-ssd-nonreplicated", * zone: "ru-central1-b", * diskPlacementPolicy: { * diskPlacementGroupId: _this.id, * }, * }); * ``` * * ## Import * * A disk can be imported using any of these accepted formats * * ```sh * $ pulumi import yandex:index/computeDisk:ComputeDisk default disk_id * ``` */ class ComputeDisk extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["blockSize"] = state ? state.blockSize : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["diskPlacementPolicy"] = state ? state.diskPlacementPolicy : undefined; resourceInputs["folderId"] = state ? state.folderId : undefined; resourceInputs["imageId"] = state ? state.imageId : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["productIds"] = state ? state.productIds : undefined; resourceInputs["size"] = state ? state.size : undefined; resourceInputs["snapshotId"] = state ? state.snapshotId : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["zone"] = state ? state.zone : undefined; } else { const args = argsOrState; resourceInputs["blockSize"] = args ? args.blockSize : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["diskPlacementPolicy"] = args ? args.diskPlacementPolicy : undefined; resourceInputs["folderId"] = args ? args.folderId : undefined; resourceInputs["imageId"] = args ? args.imageId : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["size"] = args ? args.size : undefined; resourceInputs["snapshotId"] = args ? args.snapshotId : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["zone"] = args ? args.zone : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["productIds"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ComputeDisk.__pulumiType, name, resourceInputs, opts); } /** * Get an existing ComputeDisk 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 ComputeDisk(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ComputeDisk. 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'] === ComputeDisk.__pulumiType; } } exports.ComputeDisk = ComputeDisk; /** @internal */ ComputeDisk.__pulumiType = 'yandex:index/computeDisk:ComputeDisk'; //# sourceMappingURL=computeDisk.js.map