dtcloud_elastic_ip (Data Source)
Looks up one elastic IP, by id or by address.
Address lookup is the useful half: an address is what a person knows, since it is in a DNS record or in a firewall rule, while its id is written down nowhere outside the platform.
Example Usage
# By address -- the half that is actually useful, since an address is what is
# written down in DNS or in somebody's firewall rule.
data "dtcloud_elastic_ip" "web" {
ip_address = "203.0.113.42"
}
data "dtcloud_elastic_ip" "by_id" {
id = var.elastic_ip_id
}
Schema
Optional
id(String) ID of the elastic IP to look up. Give this orip_address.ip_address(String) Public address to look up. Give this orid. Addresses are unique.
Read-Only
assigned_id(String) ID of the VM or load balancer the platform reports the address as assigned to.assigned_to(String) Name of that VM or load balancer.assigned_type(String)VM,LB, or empty when the address is unassociated.created_at(String) When the address was allocated, in RFC 3339 format.description(String) Description of the address.device_id(String) ID of the resource behind the port.device_owner(String) What kind of thing is behind the port, e.g.compute:nova.fixed_ip_address(String) Address on that port the traffic is mapped to.floating_network_id(String) ID of the external network the address came from.network_name(String) Name of that external network, as the platform reports it.port_id(String) Port the address is pointed at, empty when unassociated.router_id(String) Router carrying the traffic.status(String)ACTIVEwhen associated,DOWNwhen not.updated_at(String) When it was last changed, in RFC 3339 format.
Behaviour worth knowing
- Every read costs two calls. The list endpoint resolves an address to an id, and it is the only
place the external network's name and the name of the machine behind the address appear
(
network_name,assigned_to). The details endpoint carries the raw fields. The API builds each row of that list from further calls of its own, so avoid this inside a largefor_each. - An address that does not exist is an error, not an empty result.