Provides a Cloudflare Load Balancer pool resource. This provides a pool of origins that can be used by a Cloudflare Load Balancer.
resource "cloudflare_load_balancer_pool" "example" {
account_id = "f037e56e89293a057740de681ac9abbe"
name = "example-pool"
origins {
name = "example-1"
address = "192.0.2.1"
enabled = false
header {
header = "Host"
values = ["example-1"]
}
}
origins {
name = "example-2"
address = "192.0.2.2"
header {
header = "Host"
values = ["example-2"]
}
}
latitude = 55
longitude = -12
description = "example load balancer pool"
enabled = false
minimum_origins = 1
notification_email = "someone@example.com"
load_shedding {
default_percent = 55
default_policy = "random"
session_percent = 12
session_policy = "hash"
}
origin_steering {
policy = "random"
}
}
account_id
(String) The account identifier to target for the resource.name
(String) A short name (tag) for the pool.origins
(Block Set, Min: 1) The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. (see below for nested schema)check_regions
(Set of String) A list of regions (specified by region code) from which to run health checks. Empty means every Cloudflare data center (the default), but requires an Enterprise plan. Region codes can be found here.description
(String) Free text description.enabled
(Boolean) Whether to enable (the default) this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). Defaults to true
.latitude
(Number) The latitude this pool is physically located at; used for proximity steering.load_shedding
(Block Set) Setting for controlling load shedding for this pool. (see below for nested schema)longitude
(Number) The longitude this pool is physically located at; used for proximity steering.minimum_origins
(Number) The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and we will failover to the next available pool. Defaults to 1
.monitor
(String) The ID of the Monitor to use for health checking origins within this pool.notification_email
(String) The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list.origin_steering
(Block Set) Set an origin steering policy to control origin selection within a pool. (see below for nested schema)created_on
(String) The RFC3339 timestamp of when the load balancer was created.id
(String) The ID of this resource.modified_on
(String) The RFC3339 timestamp of when the load balancer was last modified.origins
Required:
address
(String) The IP address (IPv4 or IPv6) of the origin, or the publicly addressable hostname.name
(String) A human-identifiable name for the origin.Optional:
enabled
(Boolean) Whether this origin is enabled. Disabled origins will not receive traffic and are excluded from health checks. Defaults to true
.header
(Block Set) HTTP request headers. (see below for nested schema)weight
(Number) The weight (0.01 - 1.00) of this origin, relative to other origins in the pool. Equal values mean equal weighting. A weight of 0 means traffic will not be sent to this origin, but health is still checked. When origin_steering.policy="least_outstanding_requests"
, weight is used to scale the origin's outstanding requests. When origin_steering.policy="least_connections"
, weight is used to scale the origin's open connections. Defaults to 1
.origins.header
Required:
header
(String) HTTP Header name.values
(Set of String) Values for the HTTP headers.load_shedding
Optional:
default_percent
(Number) Percent of traffic to shed 0 - 100. Defaults to 0
.default_policy
(String) Method of shedding traffic. Available values: ""
, hash
, random
. Defaults to ""
.session_percent
(Number) Percent of session traffic to shed 0 - 100. Defaults to 0
.session_policy
(String) Method of shedding traffic. Available values: ""
, hash
. Defaults to ""
.origin_steering
Optional:
policy
(String) Origin steering policy to be used. Value random
selects an origin randomly. Value hash
selects an origin by computing a hash over the CF-Connecting-IP address. Value least_outstanding_requests
selects an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others. Value least_connections
selects an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections. Available values: ""
, hash
, random
, least_outstanding_requests
, least_connections
. Defaults to random
.Import is supported using the following syntax:
$ terraform import cloudflare_load_balancer_pool.example <account_id>/<load_balancer_pool_id>