Skip to main content

dtcloud_lb (Data Source)

Looks up one load balancer by ID.

Lookup is by id rather than by name, because load balancer names are not unique.

Example Usage​

# Lookup is by id: load balancer names are not unique.
data "dtcloud_lb" "existing" {
id = "3d372446-4c75-4327-9511-98442456162f"
}

# The VIP sits on a network block rather than a top-level field.
output "vip" {
value = data.dtcloud_lb.existing.network[0].ip
}

Schema​

Required​

  • id (String) ID of the load balancer.

Read-Only​

  • balancing_pools (Number) Number of balancing pools.
  • created_on (String) Creation timestamp as reported by the API.
  • description (String) Free-text description.
  • flavor_name (String) Human-readable flavor name.
  • floating_ip (String) Floating IP, when one is associated.
  • high_availability (String) High-availability mode.
  • members_state (List of String) Operating state of each member.
  • members_total (Number) Total number of members.
  • name (String) Name of the load balancer.
  • network (List of Object) The network the load balancer's VIP sits on. (see below for nested schema)
  • status (String) Provisioning status.

Nested Schema for network​

Read-Only:

  • id (String)
  • ip (String)
  • name (String)

Behaviour worth knowing​

  • Use this for a load balancer Terraform did not create. Declaring it as a resource instead would hand Terraform ownership, and a later destroy would take down everything behind it.
  • The VIP is reported inside network, not as a top-level field.
  • status is one title-case word. Disabled means no listener yet, Unknown means a pool with no health monitor; neither is a failure.