Skip to main content

dtcloud_snapshot (Data Source)

Looks up one snapshot by id.

Use it to reference a snapshot Terraform did not take. Declaring such a snapshot as a resource would hand Terraform ownership of it, and a later destroy would delete the copy it was there to protect.

Example Usage​

data "dtcloud_snapshot" "nightly" {
id = var.snapshot_id
}

Schema​

Required​

  • id (String) ID of the snapshot to look up.

Read-Only​

  • created_at (String) When the snapshot was taken, as the platform reports it. The API sends no timezone, and the value is passed through unchanged.
  • description (String) Free-text description, as the platform reports it.
  • name (String) Name of the snapshot.
  • progress (String) How far the copy has got, as a percentage string such as 100%. The only visible sign that a large snapshot is still being written.
  • project_id (String) ID of the project the snapshot belongs to.
  • size (Number) Size in GB, inherited from the source volume. A snapshot cannot be resized; it is as large as the volume was when it was taken.
  • status (String) Status reported by the platform. available is the only resting state.
  • storage_policy (String) Name of the storage policy backing the snapshot, resolved from volume_type_id. Empty if the storage-policies endpoint could not be read.
  • updated_at (String) When the snapshot's metadata last changed. Empty until it is first renamed or re-described.
  • volume_id (String) ID of the volume the snapshot was taken from.
  • volume_type_id (String) ID of the volume type backing the snapshot, as the snapshots endpoint reports it. storage_policy is the same thing by name.

Behaviour worth knowing​

  • The same fields as the resource, description included, read from the same endpoint.
  • storage_policy is resolved by the provider from volume_type_id, and is empty if the storage-policies endpoint cannot be read.
  • A snapshot that does not exist is an error, not an empty result, so a configuration that depends on it fails here rather than somewhere further down.