digitalocean_regions

Retrieve information about all supported DigitalOcean regions, with the ability to filter and sort the results. If no filters are specified, all regions will be returned.

Note: You can use the digitalocean_region data source to obtain metadata about a single region if you already know the slug to retrieve.

Example Usage

Use the filter block with a key string and values list to filter regions.

For example to find all available regions:

data "digitalocean_regions" "available" {
  filter {
    key    = "available"
    values = ["true"]
  }
}

You can filter on multiple fields and sort the results as well:

data "digitalocean_regions" "available" {
  filter {
    key    = "available"
    values = ["true"]
  }
  filter {
    key    = "features"
    values = ["private_networking"]
  }
  sort {
    key       = "name"
    direction = "desc"
  }
}

Argument Reference

filter supports the following arguments:

sort supports the following arguments:

Attributes Reference