arvancloud_cdn_domain_active_health_check (Resource)
Domain's active health check.
Example Usage
resource "arvancloud_cdn_domain_load_balancer" "example" {
domain = "cdn-terraform.ir"
name = "from-terraform"
description = "An example load balancer"
status = true
method = "cluster_rr"
time_slice = "10s"
}
resource "arvancloud_cdn_domain_load_balancer_pool" "example" {
domain = arvancloud_cdn_domain_load_balancer.example.domain
load_balancer = arvancloud_cdn_domain_load_balancer.example.id
description = "Pool description"
status = true
priority = 0
method = "cluster_rr"
keepalive = "on"
regions = ["THR"]
next_upstream_tcp = "on"
next_upstream_codes = {
get = [500, 404]
head = [503]
options = [404],
delete = [502]
}
}
resource "arvancloud_cdn_domain_load_balancer_pool_origin" "first-origin" {
domain = arvancloud_cdn_domain_load_balancer_pool.example.domain
load_balancer = arvancloud_cdn_domain_load_balancer_pool.example.load_balancer
pool = arvancloud_cdn_domain_load_balancer_pool.example.id
status = true
address = "1.2.3.5"
port = 8085
weight = 1
protocol = "http"
host_header = ""
}
resource "arvancloud_cdn_domain_load_balancer_pool_origin" "second-origin" {
domain = arvancloud_cdn_domain_load_balancer_pool.example.domain
load_balancer = arvancloud_cdn_domain_load_balancer_pool.example.load_balancer
pool = arvancloud_cdn_domain_load_balancer_pool.example.id
status = true
address = "3.3.3.3"
port = 443
weight = 1
protocol = "http"
host_header = ""
}
resource "arvancloud_cdn_domain_active_health_check" "example" {
domain = arvancloud_cdn_domain_load_balancer_pool.example.domain
pool = arvancloud_cdn_domain_load_balancer_pool.example.id
depends_on = [arvancloud_cdn_domain_load_balancer_pool_origin.first-origin, arvancloud_cdn_domain_load_balancer_pool_origin.second-origin]
description = "New Desc"
interval = 60000
name = "pool-name"
request_config = {
http = {
allow_insecure = true
expected_response = {
body = "some body"
codes = [
200,
300
]
headers = {
key = [
"value"
],
what = [
"value"
]
}
},
headers = {
key = "value"
},
method = "GET"
path = "/path"
port = 801,
timeout = 15000
},
tcp = null
}
retries = 3
status = true
threshold = 1
type = "HTTP"
zones = [
{
id = "60cd5dc8-911e-11ed-9adb-9e3a26780618"
monitoring_level = "critical"
}
]
}
Schema
Required
description(String) Description of the active health check.domain(String) UUID or the name of the domain.interval(Number) Interval between health checks in milliseconds.name(String) Name of the active health check.pool(String) UUID of the pool.request_config(Attributes) Configuration for the health check request. (see below for nested schema)retries(Number) Number of retries before marking the check as failed.status(Boolean) Status of the active health check.threshold(Number) Number of failed checks before marking the origin as unhealthy.type(String) Type of the active health check (TCP, HTTP, HTTPS).zones(Attributes List) List of zones to monitor. (see below for nested schema)
Optional
id(String) UUID of the active health check.
Read-Only
last_updated(String) Timestamp of the last Terraform update of the domain.
Nested Schema for request_config
Optional:
http(Attributes) HTTP configuration for the health check. (see below for nested schema)tcp(Attributes) TCP configuration for the health check. (see below for nested schema)
Nested Schema for request_config.http
Required:
allow_insecure(Boolean) Whether to allow insecure connections.expected_response(Attributes) Expected response configuration. (see below for nested schema)headers(Map of String) HTTP headers to send.method(String) HTTP method to use.path(String) Path to check.port(Number) Port to check.timeout(Number) Timeout in milliseconds.
Nested Schema for request_config.http.expected_response
Required:
body(String) Expected response body.codes(List of Number) Expected HTTP status codes.headers(Map of List of String) Expected HTTP headers.
Nested Schema for request_config.tcp
Required:
port(Number) Port to check.timeout(Number) Timeout in milliseconds.
Nested Schema for zones
Required:
id(String) UUID of the zone.monitoring_level(String) Monitoring level of the zone (critical, non-critical, off).
Import
Import is supported using the following syntax:
terraform import cdn_domain_load_balancer.example cdn-terraform.ir,1a700f5a-acef-4786-9192-4960dcf18449
terraform import cdn_domain_load_balancer_pool.example cdn-terraform.ir,1a700f5a-acef-4786-9192-4960dcf18449,b0f19e8c-3612-452d-940b-05cb10f02ba1
terraform import cdn_domain_load_balancer_pool_origin.first-origin cdn-terraform.ir,1a700f5a-acef-4786-9192-4960dcf18449,b0f19e8c-3612-452d-940b-05cb10f02ba1,7b406e15-9335-4f5d-bddd-ffd07473728a
terraform import cdn_domain_active_health_check.example cdn-terraform.ir,1a700f5a-acef-4786-9192-4960dcf18449