Healthchecks
resource cloudflare_healthcheck
required
optional
A list of regions from which to run health checks. Null means Cloudflare will pick a default region.
The number of consecutive fails required from a health check before changing the health to unhealthy.
The number of consecutive successes required from a health check before changing the health to healthy.
The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.
The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
cloudflare_healthcheck
resource "cloudflare_healthcheck" "example_healthcheck" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
address = "www.example.com"
name = "server-1"
check_regions = ["WEU", "ENAM"]
consecutive_fails = 0
consecutive_successes = 0
description = "Health check for www.example.com"
http_config = {
allow_insecure = true
expected_body = "success"
expected_codes = ["2xx", "302"]
follow_redirects = true
header = {
Host = ["example.com"]
X-App-ID = ["abc123"]
}
method = "GET"
path = "/health"
port = 0
}
interval = 0
retries = 0
suspended = true
tcp_config = {
method = "connection_established"
port = 0
}
timeout = 0
type = "HTTPS"
}
data cloudflare_healthcheck
computed
The number of consecutive fails required from a health check before changing the health to unhealthy.
The number of consecutive successes required from a health check before changing the health to healthy.
The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.
A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.
The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.
cloudflare_healthcheck
data "cloudflare_healthcheck" "example_healthcheck" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
healthcheck_id = "023e105f4ecef8ad9ca31a8372d0c353"
}