dtcloud_volumes (Data Source)
Lists the volumes visible to the caller.
The list endpoint reports a flatter shape than the details one: the attached machine's name and
status are folded onto the volume, and the size arrives as text such as "20 GB".
Example Usage
data "dtcloud_volumes" "all" {}
data "dtcloud_volumes" "on_web" {
attached_to_id = dtcloud_vm.web.id
}
Schema
Optional
attached_to_id(String) Only return volumes attached to this VM. Applied by the provider — the API has no filter.name(String) Only return volumes with this exact name. Applied by the provider — the API has no filter.
Read-Only
id(String) The ID of this resource.volumes(List of Object) The volumes that matched. (see below for nested schema)
Nested Schema for volumes
Read-Only:
attached_to(String)attached_to_id(String)attached_to_status(String)bootable(Boolean)id(String)is_detachable(Boolean)name(String)size(Number)status(String)storage_policy(String)volume_type(String)
Behaviour worth knowing
warning
The filters are applied by the provider, not the API. The list route takes no query parameters, so every read fetches every volume. The filters are a convenience, not a smaller request.
sizeis normalised to a whole number of GB, so it means the same thing here, ondtcloud_volumeand on the resource.- There is no image metadata and there are no timestamps here. Read one volume with
dtcloud_volumewhen you need them.