Skip to main content

dtcloud_lb_health_monitor (Resource)

Manages the health check attached to a pool, which decides whether a member still receives traffic.

Example Usage​

resource "dtcloud_lb_health_monitor" "web" {
lb_id = dtcloud_lb.public.id
pool_id = dtcloud_lb_pool.web.pool_id

# A pool can carry only one monitor; a second one is refused.
type = "HTTP"
url_path = "/healthz"

interval = 10
timeout = 5
healthy_threshold = 2
unhealthy_threshold = 3
}

Schema​

Required​

  • healthy_threshold (Number) Consecutive successes before a member counts as healthy (1-10).
  • interval (Number) Seconds between probes (5-300).
  • lb_id (String) ID of the load balancer. Changing this forces a new resource to be created.
  • pool_id (String) ID of the pool to monitor. A pool can have only one monitor. Changing this forces a new resource to be created.
  • timeout (Number) Seconds to wait for a probe response (5-60).
  • type (String) Probe type. One of: HTTP, HTTPS, TCP, PING. Changing this forces a new resource to be created.
  • unhealthy_threshold (Number) Consecutive failures before a member counts as unhealthy (1-10).

Optional​

  • timeouts (Block, Optional) (see below for nested schema)
  • url_path (String) Path requested by HTTP and HTTPS probes, e.g. /healthz.

Read-Only​

  • expected_codes (String) Response codes treated as healthy.
  • health_monitor_id (String) ID of the monitor on its own, without the load balancer prefix.
  • http_method (String) HTTP method used by the probe.
  • id (String) The ID of this resource.
  • name (String) Name assigned by the platform.
  • operating_status (String) Operating status.
  • provisioning_status (String) Provisioning status.

Nested Schema for timeouts​

Optional:

  • create (String)
  • delete (String)
  • update (String)

Behaviour worth knowing​

  • A pool can carry only one monitor. Creating a second one for the same pool is refused by the platform.
  • type and pool_id are fixed at creation. The timings, the thresholds and url_path change in place.
  • url_path and expected_codes apply to HTTP and HTTPS probes only. A TCP or PING monitor ignores them.

Timeouts​

create, update and delete each default to 15 minutes.

Import​

# <load-balancer-id>:<health-monitor-id>
terraform import dtcloud_lb_health_monitor.web 3d372446-4c75-4327-9511-98442456162f:9a71c2d8-3f65-4b12-8ad0-6e5c4b9f2a17