Volume

Provides a DigitalOcean Block Storage volume which can be attached to a Droplet in order to provide expanded storage.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var foobarVolume = new DigitalOcean.Volume("foobarVolume", new DigitalOcean.VolumeArgs
        {
            Region = "nyc1",
            Size = 100,
            InitialFilesystemType = "ext4",
            Description = "an example volume",
        });
        var foobarDroplet = new DigitalOcean.Droplet("foobarDroplet", new DigitalOcean.DropletArgs
        {
            Size = "s-1vcpu-1gb",
            Image = "ubuntu-18-04-x64",
            Region = "nyc1",
        });
        var foobarVolumeAttachment = new DigitalOcean.VolumeAttachment("foobarVolumeAttachment", new DigitalOcean.VolumeAttachmentArgs
        {
            DropletId = foobarDroplet.Id,
            VolumeId = foobarVolume.Id,
        });
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

foobar_volume = digitalocean.Volume("foobarVolume",
    region="nyc1",
    size=100,
    initial_filesystem_type="ext4",
    description="an example volume")
foobar_droplet = digitalocean.Droplet("foobarDroplet",
    size="s-1vcpu-1gb",
    image="ubuntu-18-04-x64",
    region="nyc1")
foobar_volume_attachment = digitalocean.VolumeAttachment("foobarVolumeAttachment",
    droplet_id=foobar_droplet.id,
    volume_id=foobar_volume.id)
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const foobarVolume = new digitalocean.Volume("foobarVolume", {
    region: "nyc1",
    size: 100,
    initialFilesystemType: "ext4",
    description: "an example volume",
});
const foobarDroplet = new digitalocean.Droplet("foobarDroplet", {
    size: "s-1vcpu-1gb",
    image: "ubuntu-18-04-x64",
    region: "nyc1",
});
const foobarVolumeAttachment = new digitalocean.VolumeAttachment("foobarVolumeAttachment", {
    dropletId: foobarDroplet.id,
    volumeId: foobarVolume.id,
});

Create a Volume Resource

new Volume(name: string, args: VolumeArgs, opts?: CustomResourceOptions);
def Volume(resource_name, opts=None, description=None, filesystem_type=None, initial_filesystem_label=None, initial_filesystem_type=None, name=None, region=None, size=None, snapshot_id=None, tags=None, __props__=None);
func NewVolume(ctx *Context, name string, args VolumeArgs, opts ...ResourceOption) (*Volume, error)
public Volume(string name, VolumeArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args VolumeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args VolumeArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VolumeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Volume Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Volume resource accepts the following input properties:

Region string

The region that the block storage volume will be created in.

Size int

The size of the block storage volume in GiB. If updated, can only be expanded.

Description string

A free-form text field up to a limit of 1024 bytes to describe a block storage volume.

FilesystemType string

Filesystem type (xfs or ext4) for the block storage volume.

Deprecated: This fields functionality has been replaced by initial_filesystem_type. The property will still remain as a computed attribute representing the current volumes filesystem type.

InitialFilesystemLabel string

Initial filesystem label for the block storage volume.

InitialFilesystemType string

Initial filesystem type (xfs or ext4) for the block storage volume.

Name string

A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and “-”, up to a limit of 64 characters.

SnapshotId string

The ID of an existing volume snapshot from which the new volume will be created. If supplied, the region and size will be limitied on creation to that of the referenced snapshot

Tags List<string>

A list of the tags to be applied to this Volume.

Region string

The region that the block storage volume will be created in.

Size int

The size of the block storage volume in GiB. If updated, can only be expanded.

Description string

A free-form text field up to a limit of 1024 bytes to describe a block storage volume.

FilesystemType string

Filesystem type (xfs or ext4) for the block storage volume.

Deprecated: This fields functionality has been replaced by initial_filesystem_type. The property will still remain as a computed attribute representing the current volumes filesystem type.

InitialFilesystemLabel string

Initial filesystem label for the block storage volume.

InitialFilesystemType string

Initial filesystem type (xfs or ext4) for the block storage volume.

Name string

A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and “-”, up to a limit of 64 characters.

SnapshotId string

The ID of an existing volume snapshot from which the new volume will be created. If supplied, the region and size will be limitied on creation to that of the referenced snapshot

Tags []string

A list of the tags to be applied to this Volume.

region Region

The region that the block storage volume will be created in.

size number

The size of the block storage volume in GiB. If updated, can only be expanded.

description string

A free-form text field up to a limit of 1024 bytes to describe a block storage volume.

filesystemType string

Filesystem type (xfs or ext4) for the block storage volume.

Deprecated: This fields functionality has been replaced by initial_filesystem_type. The property will still remain as a computed attribute representing the current volumes filesystem type.

initialFilesystemLabel string

Initial filesystem label for the block storage volume.

initialFilesystemType FilesystemType

Initial filesystem type (xfs or ext4) for the block storage volume.

name string

A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and “-”, up to a limit of 64 characters.

snapshotId string

The ID of an existing volume snapshot from which the new volume will be created. If supplied, the region and size will be limitied on creation to that of the referenced snapshot

tags string[]

A list of the tags to be applied to this Volume.

region str

The region that the block storage volume will be created in.

size float

The size of the block storage volume in GiB. If updated, can only be expanded.

description str

A free-form text field up to a limit of 1024 bytes to describe a block storage volume.

filesystem_type str

Filesystem type (xfs or ext4) for the block storage volume.

Deprecated: This fields functionality has been replaced by initial_filesystem_type. The property will still remain as a computed attribute representing the current volumes filesystem type.

initial_filesystem_label str

Initial filesystem label for the block storage volume.

initial_filesystem_type str

Initial filesystem type (xfs or ext4) for the block storage volume.

name str

A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and “-”, up to a limit of 64 characters.

snapshot_id str

The ID of an existing volume snapshot from which the new volume will be created. If supplied, the region and size will be limitied on creation to that of the referenced snapshot

tags List[str]

A list of the tags to be applied to this Volume.

Outputs

All input properties are implicitly available as output properties. Additionally, the Volume resource produces the following output properties:

DropletIds List<int>

A list of associated droplet ids.

FilesystemLabel string

Filesystem label for the block storage volume.

Id string
The provider-assigned unique ID for this managed resource.
VolumeUrn string

The uniform resource name for the volume.

DropletIds []int

A list of associated droplet ids.

FilesystemLabel string

Filesystem label for the block storage volume.

Id string
The provider-assigned unique ID for this managed resource.
VolumeUrn string

The uniform resource name for the volume.

dropletIds number[]

A list of associated droplet ids.

filesystemLabel string

Filesystem label for the block storage volume.

id string
The provider-assigned unique ID for this managed resource.
volumeUrn string

The uniform resource name for the volume.

droplet_ids List[Integer]

A list of associated droplet ids.

filesystem_label str

Filesystem label for the block storage volume.

id str
The provider-assigned unique ID for this managed resource.
volume_urn str

The uniform resource name for the volume.

Look up an Existing Volume Resource

Get an existing Volume resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: VolumeState, opts?: CustomResourceOptions): Volume
static get(resource_name, id, opts=None, description=None, droplet_ids=None, filesystem_label=None, filesystem_type=None, initial_filesystem_label=None, initial_filesystem_type=None, name=None, region=None, size=None, snapshot_id=None, tags=None, volume_urn=None, __props__=None);
func GetVolume(ctx *Context, name string, id IDInput, state *VolumeState, opts ...ResourceOption) (*Volume, error)
public static Volume Get(string name, Input<string> id, VolumeState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Description string

A free-form text field up to a limit of 1024 bytes to describe a block storage volume.

DropletIds List<int>

A list of associated droplet ids.

FilesystemLabel string

Filesystem label for the block storage volume.

FilesystemType string

Filesystem type (xfs or ext4) for the block storage volume.

Deprecated: This fields functionality has been replaced by initial_filesystem_type. The property will still remain as a computed attribute representing the current volumes filesystem type.

InitialFilesystemLabel string

Initial filesystem label for the block storage volume.

InitialFilesystemType string

Initial filesystem type (xfs or ext4) for the block storage volume.

Name string

A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and “-”, up to a limit of 64 characters.

Region string

The region that the block storage volume will be created in.

Size int

The size of the block storage volume in GiB. If updated, can only be expanded.

SnapshotId string

The ID of an existing volume snapshot from which the new volume will be created. If supplied, the region and size will be limitied on creation to that of the referenced snapshot

Tags List<string>

A list of the tags to be applied to this Volume.

VolumeUrn string

The uniform resource name for the volume.

Description string

A free-form text field up to a limit of 1024 bytes to describe a block storage volume.

DropletIds []int

A list of associated droplet ids.

FilesystemLabel string

Filesystem label for the block storage volume.

FilesystemType string

Filesystem type (xfs or ext4) for the block storage volume.

Deprecated: This fields functionality has been replaced by initial_filesystem_type. The property will still remain as a computed attribute representing the current volumes filesystem type.

InitialFilesystemLabel string

Initial filesystem label for the block storage volume.

InitialFilesystemType string

Initial filesystem type (xfs or ext4) for the block storage volume.

Name string

A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and “-”, up to a limit of 64 characters.

Region string

The region that the block storage volume will be created in.

Size int

The size of the block storage volume in GiB. If updated, can only be expanded.

SnapshotId string

The ID of an existing volume snapshot from which the new volume will be created. If supplied, the region and size will be limitied on creation to that of the referenced snapshot

Tags []string

A list of the tags to be applied to this Volume.

VolumeUrn string

The uniform resource name for the volume.

description string

A free-form text field up to a limit of 1024 bytes to describe a block storage volume.

dropletIds number[]

A list of associated droplet ids.

filesystemLabel string

Filesystem label for the block storage volume.

filesystemType string

Filesystem type (xfs or ext4) for the block storage volume.

Deprecated: This fields functionality has been replaced by initial_filesystem_type. The property will still remain as a computed attribute representing the current volumes filesystem type.

initialFilesystemLabel string

Initial filesystem label for the block storage volume.

initialFilesystemType FilesystemType

Initial filesystem type (xfs or ext4) for the block storage volume.

name string

A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and “-”, up to a limit of 64 characters.

region Region

The region that the block storage volume will be created in.

size number

The size of the block storage volume in GiB. If updated, can only be expanded.

snapshotId string

The ID of an existing volume snapshot from which the new volume will be created. If supplied, the region and size will be limitied on creation to that of the referenced snapshot

tags string[]

A list of the tags to be applied to this Volume.

volumeUrn string

The uniform resource name for the volume.

description str

A free-form text field up to a limit of 1024 bytes to describe a block storage volume.

droplet_ids List[Integer]

A list of associated droplet ids.

filesystem_label str

Filesystem label for the block storage volume.

filesystem_type str

Filesystem type (xfs or ext4) for the block storage volume.

Deprecated: This fields functionality has been replaced by initial_filesystem_type. The property will still remain as a computed attribute representing the current volumes filesystem type.

initial_filesystem_label str

Initial filesystem label for the block storage volume.

initial_filesystem_type str

Initial filesystem type (xfs or ext4) for the block storage volume.

name str

A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and “-”, up to a limit of 64 characters.

region str

The region that the block storage volume will be created in.

size float

The size of the block storage volume in GiB. If updated, can only be expanded.

snapshot_id str

The ID of an existing volume snapshot from which the new volume will be created. If supplied, the region and size will be limitied on creation to that of the referenced snapshot

tags List[str]

A list of the tags to be applied to this Volume.

volume_urn str

The uniform resource name for the volume.

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.