terraform/website/source/docs/providers/do/r/volume.markdown

1.3 KiB

layout page_title sidebar_current description
digitalocean DigitalOcean: digitalocean_volume docs-do-resource-volume Provides a DigitalOcean volume resource.

digitalocean_volume

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

Example Usage

resource "digitalocean_volume" "foobar" {
    region      = "nyc1"
    name        = "baz"
    size        = 100
    description = "an example volume"
}

resource "digitalocean_droplet" "foobar" {
    name       = "baz"
    size       = "1gb"
    image      = "coreos-stable"
    region     = "nyc1"
    volume_ids = ["${digitalocean_volume.foobar.id}"]
}

Argument Reference

The following arguments are supported:

  • region - (Required) The region that the block storage volume will be created in.
  • name - (Required) 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.
  • size - (Required) The size of the block storage volume in GiB.
  • description - (Optional) A free-form text field up to a limit of 1024 bytes to describe a block storage volume.

Attributes Reference

The following attributes are exported:

  • id - The unique identifier for the block storage volume.