digitalocean_regions
Generated on 10 Jun 2025
from Terraform version
v2.56.0
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
- (Optional) Filter the results. Thefilter
block is documented below.sort
- (Optional) Sort the results. Thesort
block is documented below.
filter
supports the following arguments:
-
key
- (Required) Filter the regions by this key. This may be one ofslug
,name
,available
,features
, orsizes
. -
values
- (Required) A list of values to match against thekey
field. Only retrieves regions where thekey
field takes on one or more of the values provided here. -
match_by
- (Optional) One ofexact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field. -
all
- (Optional) Set totrue
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.
sort
supports the following arguments:
key
- (Required) Sort the regions by this key. This may be one ofslug
,name
, oravailable
.direction
- (Required) The sort direction. This may be eitherasc
ordesc
.
Attributes Reference
regions
- A set of regions satisfying anyfilter
andsort
criteria. Each region has the following attributes:slug
- A human-readable string that is used as a unique identifier for each region.name
- The display name of the region.available
- A boolean value that represents whether new Droplets can be created in this region.sizes
- A set of identifying slugs for the Droplet sizes available in this region.features
- A set of features available in this region.