Skip to main content

dtcloud_elastic_ips (Data Source)

Lists the elastic IPs allocated to the caller.

The most useful question it answers is what you are paying for that nothing is using: an allocated address that is not associated still occupies quota and is still billed. status = "DOWN" asks exactly that.

Example Usage​

data "dtcloud_elastic_ips" "all" {}

# Allocated but attached to nothing: still billed, still using quota.
data "dtcloud_elastic_ips" "idle" {
status = "DOWN"
}

Schema​

Optional​

  • assigned_type (String) Only return addresses attached to a VM, to an LB, or attached to nothing (none).
  • floating_network_id (String) Only return addresses allocated from this external network.
  • status (String) Only return addresses in this status: ACTIVE, DOWN or ERROR.

Read-Only​

  • elastic_ips (List of Object) The addresses that matched. (see below for nested schema)
  • id (String) The ID of this resource.
  • ids (List of String) Just the ids of the addresses that matched.
  • ip_addresses (List of String) Just the addresses, in the same order as ids.

Nested Schema for elastic_ips​

Read-Only:

  • assigned_id (String)
  • assigned_to (String)
  • assigned_type (String)
  • fixed_ip_address (String)
  • floating_network_id (String)
  • id (String)
  • ip_address (String)
  • network_name (String)
  • status (String)

Behaviour worth knowing​

  • The filters are applied by the provider. The list route takes no query parameters, so every address is fetched either way, and the API builds each row from three further calls of its own. When you already know which address you want, use dtcloud_elastic_ip.
  • assigned_type = "none" selects addresses attached to nothing. The API reports that as an empty string, which a filter cannot express.
  • ids and ip_addresses follow the API's order. A list that grows by one shifts every index, so look a specific address up with dtcloud_elastic_ip rather than indexing into these.