Skip to content
Start here

Monitors

resource cloudflare_load_balancer_monitor

required Expand Collapse
account_id: String

Identifier.

optional Expand Collapse
consecutive_down?: Int64

To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.

consecutive_up?: Int64

To be marked healthy the monitored origin must pass this healthcheck N consecutive times.

port?: Int64

The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).

header?: Map[List[String]]

The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors.

allow_insecure?: Bool

Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.

description?: String

Object description.

expected_body?: String

A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.

expected_codes?: String

The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.

follow_redirects?: Bool

Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.

interval?: Int64

The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.

method?: String

The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.

path?: String

The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.

probe_zone?: String

Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.

retries?: Int64

The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.

timeout?: Int64

The timeout (in seconds) before marking the health check as failed.

type?: String

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

computed Expand Collapse
id: String
created_on: String
modified_on: String

cloudflare_load_balancer_monitor

resource "cloudflare_load_balancer_monitor" "example_load_balancer_monitor" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  allow_insecure = true
  consecutive_down = 0
  consecutive_up = 0
  description = "Login page monitor"
  expected_body = "alive"
  expected_codes = "2xx"
  follow_redirects = true
  header = {
    Host = ["example.com"]
    X-App-ID = ["abc123"]
  }
  interval = 0
  method = "GET"
  path = "/health"
  port = 0
  probe_zone = "example.com"
  retries = 0
  timeout = 0
  type = "https"
}

data cloudflare_load_balancer_monitor

required Expand Collapse
monitor_id: String
account_id: String

Identifier.

computed Expand Collapse
id: String
allow_insecure: Bool

Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.

consecutive_down: Int64

To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.

consecutive_up: Int64

To be marked healthy the monitored origin must pass this healthcheck N consecutive times.

created_on: String
description: String

Object description.

expected_body: String

A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.

expected_codes: String

The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.

follow_redirects: Bool

Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.

interval: Int64

The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.

method: String

The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.

modified_on: String
path: String

The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.

port: Int64

The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).

probe_zone: String

Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.

retries: Int64

The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.

timeout: Int64

The timeout (in seconds) before marking the health check as failed.

type: String

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

header: Map[List[String]]

The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors.

cloudflare_load_balancer_monitor

data "cloudflare_load_balancer_monitor" "example_load_balancer_monitor" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  monitor_id = "f1aba936b94213e5b8dca0c0dbf1f9cc"
}

data cloudflare_load_balancer_monitors

required Expand Collapse
account_id: String

Identifier.

optional Expand Collapse
max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String
allow_insecure: Bool

Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.

consecutive_down: Int64

To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.

consecutive_up: Int64

To be marked healthy the monitored origin must pass this healthcheck N consecutive times.

created_on: String
description: String

Object description.

expected_body: String

A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.

expected_codes: String

The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.

follow_redirects: Bool

Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.

header: Map[List[String]]

The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors.

interval: Int64

The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.

method: String

The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.

modified_on: String
path: String

The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.

port: Int64

The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).

probe_zone: String

Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.

retries: Int64

The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.

timeout: Int64

The timeout (in seconds) before marking the health check as failed.

type: String

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

cloudflare_load_balancer_monitors

data "cloudflare_load_balancer_monitors" "example_load_balancer_monitors" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
}