exoscale_nlb_service (Resource)
Manage Exoscale Network Load Balancer (NLB) Services.
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
healthcheck
(Block Set, Min: 1) The service health checking configuration. (see below for nested schema)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 healthcheck 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.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)
Nested Schema for healthcheck
Required:
port
(Number) The NLB service (TCP/UDP) 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 ifmode
ishttps
).uri
(String) The healthcheck URI (must be set only ifmode
ishttp(s)
).
Nested Schema for timeouts
Optional:
create
(String)delete
(String)read
(String)update
(String)
-> 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