UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

184 lines (183 loc) 7.63 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Provides a Linode Volume resource. This can be used to create, modify, and delete Linodes Block Storage Volumes. Block Storage Volumes are removable storage disks that persist outside the life-cycle of Linode Instances. These volumes can be attached to and detached from Linode instances throughout a region. * * For more information, see [How to Use Block Storage with Your Linode](https://www.linode.com/docs/platform/block-storage/how-to-use-block-storage-with-your-linode/) and the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-volume). * * ## Example Usage * * The following example shows how one might use this resource to configure a Block Storage Volume attached to a Linode Instance. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const foobaz = new linode.Instance("foobaz", { * rootPass: "3X4mp13", * type: "g6-nanode-1", * region: "us-west", * tags: ["foobaz"], * }); * const foobar = new linode.Volume("foobar", { * label: "foo-volume", * region: foobaz.region, * linodeId: foobaz.id, * }); * ``` * * Volumes can also be attached using the Linode Instance config device map. * * ## Import * * Linodes Volumes can be imported using the Linode Volume `id`, e.g. * * ```sh * $ pulumi import linode:index/volume:Volume myvolume 1234567 * ``` */ export declare class Volume extends pulumi.CustomResource { /** * Get an existing Volume 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: string, id: pulumi.Input<pulumi.ID>, state?: VolumeState, opts?: pulumi.CustomResourceOptions): Volume; /** * Returns true if the given object is an instance of Volume. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Volume; /** * Whether Block Storage Disk Encryption is enabled or disabled on this Volume. Note: Block Storage Disk Encryption is not currently available to all users. */ readonly encryption: pulumi.Output<string>; /** * The full filesystem path for the Volume based on the Volume's label. The path is "/dev/disk/by-id/scsi-0Linode_Volume_" + the Volume label */ readonly filesystemPath: pulumi.Output<string>; /** * The label of the Linode Volume */ readonly label: pulumi.Output<string>; /** * The ID of a Linode Instance where the Volume should be attached. */ readonly linodeId: pulumi.Output<number>; /** * The region where this volume will be deployed. Examples are `"us-east"`, `"us-west"`, `"ap-south"`, etc. See all regions [here](https://api.linode.com/v4/regions). This field is optional for cloned volumes. *Changing `region` forces the creation of a new Linode Volume.*. * * - - - */ readonly region: pulumi.Output<string>; /** * Size of the Volume in GB. */ readonly size: pulumi.Output<number>; /** * The ID of a Linode Volume to clone. NOTE: Cloned volumes must be in the same region as the source volume. */ readonly sourceVolumeId: pulumi.Output<number | undefined>; /** * The status of the Linode Volume. (`creating`, `active`, `resizing`, `contactSupport`) */ readonly status: pulumi.Output<string>; /** * A list of tags applied to this object. Tags are case-insensitive and are for organizational purposes only. */ readonly tags: pulumi.Output<string[]>; readonly timeouts: pulumi.Output<outputs.VolumeTimeouts | undefined>; /** * Create a Volume resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: VolumeArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Volume resources. */ export interface VolumeState { /** * Whether Block Storage Disk Encryption is enabled or disabled on this Volume. Note: Block Storage Disk Encryption is not currently available to all users. */ encryption?: pulumi.Input<string>; /** * The full filesystem path for the Volume based on the Volume's label. The path is "/dev/disk/by-id/scsi-0Linode_Volume_" + the Volume label */ filesystemPath?: pulumi.Input<string>; /** * The label of the Linode Volume */ label?: pulumi.Input<string>; /** * The ID of a Linode Instance where the Volume should be attached. */ linodeId?: pulumi.Input<number>; /** * The region where this volume will be deployed. Examples are `"us-east"`, `"us-west"`, `"ap-south"`, etc. See all regions [here](https://api.linode.com/v4/regions). This field is optional for cloned volumes. *Changing `region` forces the creation of a new Linode Volume.*. * * - - - */ region?: pulumi.Input<string>; /** * Size of the Volume in GB. */ size?: pulumi.Input<number>; /** * The ID of a Linode Volume to clone. NOTE: Cloned volumes must be in the same region as the source volume. */ sourceVolumeId?: pulumi.Input<number>; /** * The status of the Linode Volume. (`creating`, `active`, `resizing`, `contactSupport`) */ status?: pulumi.Input<string>; /** * A list of tags applied to this object. Tags are case-insensitive and are for organizational purposes only. */ tags?: pulumi.Input<pulumi.Input<string>[]>; timeouts?: pulumi.Input<inputs.VolumeTimeouts>; } /** * The set of arguments for constructing a Volume resource. */ export interface VolumeArgs { /** * Whether Block Storage Disk Encryption is enabled or disabled on this Volume. Note: Block Storage Disk Encryption is not currently available to all users. */ encryption?: pulumi.Input<string>; /** * The label of the Linode Volume */ label: pulumi.Input<string>; /** * The ID of a Linode Instance where the Volume should be attached. */ linodeId?: pulumi.Input<number>; /** * The region where this volume will be deployed. Examples are `"us-east"`, `"us-west"`, `"ap-south"`, etc. See all regions [here](https://api.linode.com/v4/regions). This field is optional for cloned volumes. *Changing `region` forces the creation of a new Linode Volume.*. * * - - - */ region?: pulumi.Input<string>; /** * Size of the Volume in GB. */ size?: pulumi.Input<number>; /** * The ID of a Linode Volume to clone. NOTE: Cloned volumes must be in the same region as the source volume. */ sourceVolumeId?: pulumi.Input<number>; /** * A list of tags applied to this object. Tags are case-insensitive and are for organizational purposes only. */ tags?: pulumi.Input<pulumi.Input<string>[]>; timeouts?: pulumi.Input<inputs.VolumeTimeouts>; }