Skip to content

frostmoln_load_balancer (Data Source) ​

Look up a load balancer by ID or name. Exactly one of id or name must be specified.

This is how a configuration reaches a load balancer that Terraform did not create: a load balancer provisioned in the portal or with fm can today be referenced only by a hardcoded UUID or plumbed through terraform_remote_state. Look it up by name instead and the reference survives re-provisioning elsewhere. The optional vpc_id narrows a name lookup (the vpcId filter rides the request) and is echoed back from the read.

A name lookup that matches NOTHING fails the read, and so does one that matches MORE THAN ONE load balancer: the data source refuses to pick for you (the diagnostic names the colliding ids). There is no listeners or pools attribute here: those collections belong to the child resources frostmoln_lb_listener, frostmoln_lb_pool, frostmoln_lb_member and frostmoln_lb_health_monitor, so this resolver's job is the id the child resources are addressed by.

Example Usage ​

terraform
# Resolve a load balancer that Terraform did not create (provisioned in the
# portal or with `fm`) by NAME — no hardcoded UUID.
data "frostmoln_load_balancer" "edge" {
  name = "edge-https"
}

# The resolved load balancer feeds references elsewhere — e.g. the address an
# app server targets (the public address when one is attached, the VIP
# otherwise; no composed endpoint attribute exists on the wire).
locals {
  edge_address = coalesce(data.frostmoln_load_balancer.edge.public_ip_address, data.frostmoln_load_balancer.edge.vip_address)
}

# A lookup by id behaves identically for load balancers whose UUID is already
# known.
data "frostmoln_load_balancer" "by_id" {
  id = data.frostmoln_load_balancer.edge.id
}

# The optional vpc_id narrows a name lookup (sent as the vpcId filter) and is
# echoed back from the read.
data "frostmoln_load_balancer" "edge_internal" {
  name   = "edge-https"
  vpc_id = "vpc-1d2e3f4a-0000-0000-0000-000000000000"
}

# A name that matches nothing — or more than one load balancer — fails the
# read loudly rather than picking one for you. Listeners, pools, members and
# health monitors are referenced through their own resources
# (frostmoln_lb_listener, frostmoln_lb_pool, frostmoln_lb_member,
# frostmoln_lb_health_monitor); this resolver's job is the id they are
# addressed by.

Schema ​

Optional ​

  • id (String) The unique identifier of the load balancer. Exactly one of id or name must be specified.
  • name (String) The name of the load balancer. Exactly one of id or name must be specified.
  • vpc_id (String) The VPC the load balancer serves. As an INPUT it narrows a name lookup (sent as the list's vpcId filter); in the result it is the observed VPC of the resolved load balancer.

Read-Only ​

  • created_at (String) The timestamp when the load balancer was created.
  • description (String) The description of the load balancer, null when it has none.
  • flavor_id (String) The flavor the load balancer runs on, null for the platform's default flavor.
  • operating_status (String) The data-plane operating status, verbatim from the wire.
  • provisioning_status (String) The control-plane provisioning status, verbatim from the wire.
  • public_ip_address (String) The public IP address attached to the load balancer, null when the load balancer is not publicly reachable.
  • public_ip_id (String) The public IP attached to the load balancer, null when the load balancer is reachable only from inside its VPC.
  • scheme (String) The reachability scheme, internal or public — derived by the read path from whether a public IP is attached to the VIP port, so the value is platform-verified, not a restatement of the configuration.
  • status (String) The current lifecycle status of the load balancer, derived from the two status axes below.
  • subnet_id (String) The subnet ID the load balancer's VIP lives on.
  • tenant_id (String) The tenant ID that owns this load balancer.
  • type (String) The load-balancer type, l4 or l7 — null only if the platform serves a row without one (the server normalises an unset type to l7).
  • updated_at (String) The timestamp when the load balancer was last updated, null when the platform has not recorded one.
  • vip_address (String) The virtual IP address of the load balancer, null when the platform has not allocated one yet.
  • vip_port_id (String) The neutron port ID behind the VIP, null until the port exists.