UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

206 lines (205 loc) 7.41 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Attaches a Block Storage Volume to an Instance using the OpenStack * Compute (Nova) v2 API. * * ## Example Usage * * ### Basic attachment of a single volume to a single instance * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const volume1 = new openstack.blockstorage.Volume("volume_1", { * name: "volume_1", * size: 1, * }); * const instance1 = new openstack.compute.Instance("instance_1", { * name: "instance_1", * securityGroups: ["default"], * }); * const va1 = new openstack.compute.VolumeAttach("va_1", { * instanceId: instance1.id, * volumeId: volume1.id, * }); * ``` * * ### Using Multiattach-enabled volumes * * Multiattach Volumes are dependent upon your OpenStack cloud and not all * clouds support multiattach. Multiattach volumes require a volumeType that has [multiattach enabled](https://docs.openstack.org/cinder/latest/admin/volume-multiattach.html#multiattach-volume-type). * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const volume1 = new openstack.blockstorage.Volume("volume_1", { * name: "volume_1", * size: 1, * volumeType: "multiattach", * }); * const instance1 = new openstack.compute.Instance("instance_1", { * name: "instance_1", * securityGroups: ["default"], * }); * const instance2 = new openstack.compute.Instance("instance_2", { * name: "instance_2", * securityGroups: ["default"], * }); * const va1 = new openstack.compute.VolumeAttach("va_1", { * instanceId: instance1.id, * volumeId: volume1.id, * multiattach: true, * }); * const va2 = new openstack.compute.VolumeAttach("va_2", { * instanceId: instance2.id, * volumeId: volume1.id, * multiattach: true, * }, { * dependsOn: [va1], * }); * ``` * * It is recommended to use `dependsOn` for the attach resources * to enforce the volume attachments to happen one at a time. * * ## Import * * Volume Attachments can be imported using the Instance ID and Volume ID * separated by a slash, e.g. * * ```sh * $ pulumi import openstack:compute/volumeAttach:VolumeAttach va_1 89c60255-9bd6-460c-822a-e2b959ede9d2/45670584-225f-46c3-b33e-6707b589b666 * ``` */ export declare class VolumeAttach extends pulumi.CustomResource { /** * Get an existing VolumeAttach 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?: VolumeAttachState, opts?: pulumi.CustomResourceOptions): VolumeAttach; /** * Returns true if the given object is an instance of VolumeAttach. 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 VolumeAttach; readonly device: pulumi.Output<string>; /** * The ID of the Instance to attach the Volume to. */ readonly instanceId: pulumi.Output<string>; /** * Enable attachment of multiattach-capable volumes. */ readonly multiattach: pulumi.Output<boolean | undefined>; /** * The region in which to obtain the V2 Compute client. * A Compute client is needed to create a volume attachment. If omitted, the * `region` argument of the provider is used. Changing this creates a * new volume attachment. */ readonly region: pulumi.Output<string>; /** * Add a device role tag that is applied to the volume when * attaching it to the VM. Changing this creates a new volume attachment with * the new tag. Requires microversion >= 2.49. */ readonly tag: pulumi.Output<string | undefined>; /** * Map of additional vendor-specific options. * Supported options are described below. */ readonly vendorOptions: pulumi.Output<outputs.compute.VolumeAttachVendorOptions | undefined>; /** * The ID of the Volume to attach to an Instance. */ readonly volumeId: pulumi.Output<string>; /** * Create a VolumeAttach 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: VolumeAttachArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering VolumeAttach resources. */ export interface VolumeAttachState { device?: pulumi.Input<string>; /** * The ID of the Instance to attach the Volume to. */ instanceId?: pulumi.Input<string>; /** * Enable attachment of multiattach-capable volumes. */ multiattach?: pulumi.Input<boolean>; /** * The region in which to obtain the V2 Compute client. * A Compute client is needed to create a volume attachment. If omitted, the * `region` argument of the provider is used. Changing this creates a * new volume attachment. */ region?: pulumi.Input<string>; /** * Add a device role tag that is applied to the volume when * attaching it to the VM. Changing this creates a new volume attachment with * the new tag. Requires microversion >= 2.49. */ tag?: pulumi.Input<string>; /** * Map of additional vendor-specific options. * Supported options are described below. */ vendorOptions?: pulumi.Input<inputs.compute.VolumeAttachVendorOptions>; /** * The ID of the Volume to attach to an Instance. */ volumeId?: pulumi.Input<string>; } /** * The set of arguments for constructing a VolumeAttach resource. */ export interface VolumeAttachArgs { device?: pulumi.Input<string>; /** * The ID of the Instance to attach the Volume to. */ instanceId: pulumi.Input<string>; /** * Enable attachment of multiattach-capable volumes. */ multiattach?: pulumi.Input<boolean>; /** * The region in which to obtain the V2 Compute client. * A Compute client is needed to create a volume attachment. If omitted, the * `region` argument of the provider is used. Changing this creates a * new volume attachment. */ region?: pulumi.Input<string>; /** * Add a device role tag that is applied to the volume when * attaching it to the VM. Changing this creates a new volume attachment with * the new tag. Requires microversion >= 2.49. */ tag?: pulumi.Input<string>; /** * Map of additional vendor-specific options. * Supported options are described below. */ vendorOptions?: pulumi.Input<inputs.compute.VolumeAttachVendorOptions>; /** * The ID of the Volume to attach to an Instance. */ volumeId: pulumi.Input<string>; }