Skip to content

exoscale_nlb_service (Resource)

Manage Exoscale Network Load Balancer (NLB) Services.

Corresponding data source: exoscale_nlb_service_list.

Example Usage

resource "exoscale_nlb" "my_nlb" {
  zone = "ch-gva-2"
  name = "my-nlb"
}

resource "exoscale_nlb_service" "my_nlb_service" {
  nlb_id = exoscale_nlb.my_nlb.id
  zone   = exoscale_nlb.my_nlb.zone
  name   = "my-nlb-service"

  instance_pool_id = exoscale_instance_pool.my_instance_pool.id
  protocol         = "tcp"
  port             = 443
  target_port      = 8443
  strategy         = "round-robin"

  healthcheck {
    mode     = "https"
    port     = 8443
    uri      = "/healthz"
    tls_sni  = "example.net"
    interval = 5
    timeout  = 3
    retries  = 1
  }
}

Please refer to the examples directory for complete configuration examples.

Schema

Required

  • instance_pool_id (String) ❗ The exoscale_instance_pool (ID) to forward traffic to.
  • name (String) The NLB service name.
  • nlb_id (String) ❗ The parent exoscale_nlb ID.
  • port (Number) The NLB service (TCP/UDP) port.
  • target_port (Number) The (TCP/UDP) port to forward traffic to (on target instance pool members).
  • zone (String) ❗ The Exoscale Zone name.

Optional

  • description (String) A free-form text describing the NLB service.
  • healthcheck (Block Set) The service health checking configuration. (see below for nested schema)
  • protocol (String) The protocol (tcp|udp; default: tcp).
  • strategy (String) The strategy (round-robin|source-hash; default: round-robin).
  • timeouts (Block, Optional) (see below for nested schema)

Read-Only

  • id (String) The ID of this resource.
  • state (String) The current NLB service state.

Nested Schema for healthcheck

Required:

  • port (Number) The healthcheck port.

Optional:

  • interval (Number) The healthcheck interval in seconds (default: 10).
  • mode (String) The healthcheck mode (tcp|http|https; default: tcp).
  • retries (Number) The healthcheck retries (default: 1).
  • timeout (Number) The healthcheck timeout (seconds; default: 5).
  • tls_sni (String) The healthcheck TLS SNI server name (only if mode is https).
  • uri (String) The healthcheck URI (must be set only if mode is http(s)).

Nested Schema for timeouts

Optional:

  • create (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as “30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours).
  • delete (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as “30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
  • read (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as “30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
  • update (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as “30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours).

-> The symbol ❗ in an attribute indicates that modifying it, will force the creation of a new resource.

Import

# An existing NLB service may be imported by `<nlb-ID>/<service-ID>@<zone>`:

terraform import \
  exoscale_nlb_service.my_nlb_service \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6/9ecc6b8b-73d4-4211-8ced-f7f29bb79524@ch-gva-2
Last updated on