Skip to main content

dtcloud_vm_history (Data Source)

Lists what has been done to a virtual machine.

This is an event log rather than desired state, which is why it is a data source: there is nothing to create, change or destroy.

Example Usage​

data "dtcloud_vm_history" "web" {
vm_id = dtcloud_vm.web.id
}

# Newest first, so the first entry is the most recent action.
output "last_action" {
value = data.dtcloud_vm_history.web.entries[0].activity
}

Schema​

Required​

  • vm_id (String) ID of the virtual machine.

Read-Only​

  • entries (List of Object) Actions recorded against the VM, newest first as the API reports them. (see below for nested schema)
  • id (String) The ID of this resource.

Nested Schema for entries​

Read-Only:

  • activity (String)
  • date_and_time (String)
  • id (String)
  • initiator (String)

Behaviour worth knowing​

warning

Keep it out of resource arguments. The content changes whenever anything happens to the machine, Terraform's own changes included, so a resource that depends on it sees a new value on every plan and never settles. Use it for outputs, for terraform console, or for a check outside the dependency graph.

  • There is no status here. The list endpoint leaves it out; dtcloud_vm_history_entry reads one entry in full.