[ Web Proxy ]
URL:
Viewing: https://docs.digitalocean.com/reference/terraform/reference/resources/volume/ [Back]  [Original]

digitalocean_volume | DigitalOcean Documentation

For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).

digitalocean_volume

Generated on 18 Aug 2026 from Terraform version v2.100.0

Copy page as Markdown View page as Markdown

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
  initial_filesystem_type = "ext4"
  description             = "an example volume"
}

resource "digitalocean_droplet" "foobar" {
  name   = "baz"
  size   = "s-1vcpu-1gb"
  image  = "ubuntu-18-04-x64"
  region = "nyc1"
}

resource "digitalocean_volume_attachment" "foobar" {
  droplet_id = digitalocean_droplet.foobar.id
  volume_id  = digitalocean_volume.foobar.id
}

You can also create a volume from an existing snapshot.

data "digitalocean_volume_snapshot" "foobar" {
  name = "baz"
}

resource "digitalocean_volume" "foobar" {
  region      = "lon1"
  name        = "foo"
  size        = data.digitalocean_volume_snapshot.foobar.min_disk_size
  snapshot_id = data.digitalocean_volume_snapshot.foobar.id
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Import

Volumes can be imported using the volume id, e.g.

terraform import digitalocean_volume.volume 506f78a4-e098-11e5-ad9f-000f53306ae1

In this article...


We can't find any results for your search.

Try using different keywords or simplifying your search terms.


Web Proxy Viewer  |  New URL  |  Original Page