Skip to main content

openstack_compute_instance_v2

Last update:
For your information

This instruction is a copy of the official documentation for the OpenStack Terraform provider in the Terraform Registry.

Use this data source to retrieve details of a running server.

Example usage

data "openstack_compute_instance_v2" "instance" {
# Randomly generated UUID, for demonstration purposes
id = "2ba26dc6-a12d-4889-8f25-794ea5bf4453"
}

Argument reference

  • id — (Required) The instance UUID.

Attributes reference

In addition to the attributes above, the following are exported:

  • name — The server name.

  • image_id — The image ID used to create the server.

  • image_name — The image name used to create the server.

  • flavor_id — The flavor ID used to create the server.

  • flavor_name — The flavor name used to create the server.

  • user_data — The user data added during server creation.

  • security_groups — An array of security group names associated with this server.

  • availability_zone — The availability zone of this server.

  • network — An array of objects, described below.

  • access_ip_v4 — The first IPv4 address assigned to this server.

  • access_ip_v6 — The first IPv6 address assigned to this server.

  • key_pair — The name of the key pair assigned to this server.

  • tags — A set of string tags assigned to this server.

  • metadata — A set of key/value pairs available to the server.

  • created — The instance creation time.

  • updated — The last update time of the instance.

The network block is defined as follows:

  • uuid — The network UUID.

  • name — The network name.

  • fixed_ip_v4 — The IPv4 address assigned to this network port.

  • fixed_ip_v6 — The IPv6 address assigned to this network port.

  • port — The network port UUID.

  • mac — The MAC address assigned to this network interface.