digitalocean_microvms
Generated on 5 Nov 2026
from Terraform version
v2.107.0
Get information on MicroVMs for use in other resources, with the ability to filter and sort the results. If no filters are specified, all MicroVMs are returned.
The region, name, and tag_name arguments are applied by the API and
combine with logical AND. The filter and sort blocks are applied to the
results afterwards.
Note: You can use the digitalocean_microvm data source to obtain
metadata about a single MicroVM if you already know its id or unique name.
-> Note: MicroVMs are in public preview.
Example Usage
Get all MicroVMs in a region that carry a tag:
data "digitalocean_microvms" "web" {
region = "nyc3"
tag_name = "web"
}
output "names" {
value = data.digitalocean_microvms.web.micro_vms[*].name
}Get all running MicroVMs, sorted by creation time:
data "digitalocean_microvms" "running" {
filter {
key = "current_state"
values = ["running"]
}
sort {
key = "created_at"
direction = "desc"
}
}Argument Reference
region- (Optional) Only return MicroVMs in this region.name- (Optional) Only return MicroVMs with this exact name.tag_name- (Optional) Only return MicroVMs that carry this tag.filter- (Optional) Filter the results. Thefilterblock is documented below.sort- (Optional) Sort the results. Thesortblock is documented below.
filter supports the following arguments:
key- (Required) Filter the MicroVMs by this key. This may be one ofid,name,region,networking,http_protocol,current_state,failure_reason,auto_resume,ports,tags,urn, orcreated_at.values- (Required) A list of values to match against thekeyfield. Only retrieves MicroVMs where thekeyfield takes on one or more of the values provided here.match_by- (Optional) One ofexact(default),re, orsubstring. For string-typed fields, specifyreto match by using thevaluesas regular expressions, or specifysubstringto match by treating thevaluesas substrings to find within the string field.all- (Optional) Set totrueto require that a field match all of thevaluesinstead 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 thevaluesare present in the list or set.
sort supports the following arguments:
key- (Required) Sort the MicroVMs by this key. This may be one ofid,name,region,networking,http_protocol,current_state,auto_resume,urn, orcreated_at.direction- (Required) The sort direction. This may be eitherascordesc.
Attributes Reference
micro_vms- A list of MicroVMs satisfying anyfilterandsortcriteria. Each MicroVM has the same attributes as thedigitalocean_microvmdata source.