@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
165 lines (164 loc) • 4.68 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Get information on a volume for use in other resources. This data source provides
* all of the volumes properties as configured on your DigitalOcean account. This is
* useful if the volume in question is not managed by the provider or you need to utilize
* any of the volumes data.
*
* An error is triggered if the provided volume name does not exist.
*
* ## Example Usage
*
* Get the volume:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const example = digitalocean.getVolume({
* name: "app-data",
* region: "nyc3",
* });
* ```
*
* Reuse the data about a volume to attach it to a Droplet:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const example = digitalocean.getVolume({
* name: "app-data",
* region: "nyc3",
* });
* const exampleDroplet = new digitalocean.Droplet("example", {
* name: "foo",
* size: digitalocean.DropletSlug.DropletS1VCPU1GB,
* image: "ubuntu-18-04-x64",
* region: digitalocean.Region.NYC3,
* });
* const foobar = new digitalocean.VolumeAttachment("foobar", {
* dropletId: exampleDroplet.id,
* volumeId: example.then(example => example.id),
* });
* ```
*/
export declare function getVolume(args: GetVolumeArgs, opts?: pulumi.InvokeOptions): Promise<GetVolumeResult>;
/**
* A collection of arguments for invoking getVolume.
*/
export interface GetVolumeArgs {
/**
* Text describing a block storage volume.
*/
description?: string;
/**
* The name of block storage volume.
*/
name: string;
/**
* The region the block storage volume is provisioned in.
*/
region?: string;
}
/**
* A collection of values returned by getVolume.
*/
export interface GetVolumeResult {
/**
* Text describing a block storage volume.
*/
readonly description?: string;
/**
* A list of associated Droplet ids.
*/
readonly dropletIds: number[];
/**
* Filesystem label currently in-use on the block storage volume.
*/
readonly filesystemLabel: string;
/**
* Filesystem type currently in-use on the block storage volume.
*/
readonly filesystemType: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly name: string;
readonly region?: string;
/**
* The size of the block storage volume in GiB.
*/
readonly size: number;
/**
* A list of the tags associated to the Volume.
*/
readonly tags: string[];
/**
* The uniform resource name for the storage volume.
*/
readonly urn: string;
}
/**
* Get information on a volume for use in other resources. This data source provides
* all of the volumes properties as configured on your DigitalOcean account. This is
* useful if the volume in question is not managed by the provider or you need to utilize
* any of the volumes data.
*
* An error is triggered if the provided volume name does not exist.
*
* ## Example Usage
*
* Get the volume:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const example = digitalocean.getVolume({
* name: "app-data",
* region: "nyc3",
* });
* ```
*
* Reuse the data about a volume to attach it to a Droplet:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const example = digitalocean.getVolume({
* name: "app-data",
* region: "nyc3",
* });
* const exampleDroplet = new digitalocean.Droplet("example", {
* name: "foo",
* size: digitalocean.DropletSlug.DropletS1VCPU1GB,
* image: "ubuntu-18-04-x64",
* region: digitalocean.Region.NYC3,
* });
* const foobar = new digitalocean.VolumeAttachment("foobar", {
* dropletId: exampleDroplet.id,
* volumeId: example.then(example => example.id),
* });
* ```
*/
export declare function getVolumeOutput(args: GetVolumeOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetVolumeResult>;
/**
* A collection of arguments for invoking getVolume.
*/
export interface GetVolumeOutputArgs {
/**
* Text describing a block storage volume.
*/
description?: pulumi.Input<string>;
/**
* The name of block storage volume.
*/
name: pulumi.Input<string>;
/**
* The region the block storage volume is provisioned in.
*/
region?: pulumi.Input<string>;
}