Skip to content
Start here

Pools

resource cloudflare_load_balancer_pool

required Expand Collapse
account_id: String

Identifier.

name: String

A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.

origins: Set[Attributes]

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.

address?: String

The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set.

disabled_at?: Time

This field shows up only if the origin is disabled. This field is set with the time the origin was disabled.

enabled?: Bool

Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool.

header?: Attributes

The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.

host?: List[String]

The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin.

name?: String

A human-identifiable name for the origin.

port?: Int64

The port for upstream connections. A value of 0 means the default port for the protocol will be used.

virtual_network_id?: String

The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account.

weight?: Float64

The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool.

  • origin_steering.policy="least_outstanding_requests": Use weight to scale the origin's outstanding requests.
  • origin_steering.policy="least_connections": Use weight to scale the origin's open connections.
optional Expand Collapse
latitude?: Float64

The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.

longitude?: Float64

The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.

monitor?: String

The ID of the Monitor to use for checking the health of origins within this pool.

monitor_group?: String

The ID of the Monitor Group to use for checking the health of origins within this pool.

check_regions?: List[String]

A list of regions from which to run health checks. Null means every Cloudflare data center.

load_shedding?: Attributes

Configures load shedding policies and percentages for the pool.

default_percent?: Float64

The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.

default_policy?: String

The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.

session_percent?: Float64

The percent of existing sessions to shed from the pool, according to the session policy.

session_policy?: String

Only the hash policy is supported for existing sessions (to avoid exponential decay).

notification_filter?: Attributes

Filter pool and origin health notifications by resource type or health status. Use null to reset.

origin?: Attributes

Filter options for a particular resource type (pool or origin). Use null to reset.

disable?: Bool

If set true, disable notifications for this type of resource (pool or origin).

healthy?: Bool

If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).

pool?: Attributes

Filter options for a particular resource type (pool or origin). Use null to reset.

disable?: Bool

If set true, disable notifications for this type of resource (pool or origin).

healthy?: Bool

If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).

origin_steering?: Attributes

Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.

policy?: String

The type of origin steering policy to use.

  • "random": Select an origin randomly.
  • "hash": Select an origin by computing a hash over the CF-Connecting-IP address.
  • "least_outstanding_requests": Select 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.
  • "least_connections": Select 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.
description?: String

A human-readable description of the pool.

enabled?: Bool

Whether to enable (the default) or disable 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).

minimum_origins?: Int64

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 will failover to the next available pool.

notification_email?: String

This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. 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.

computed Expand Collapse
id: String
created_on: String
disabled_at: Time

This field shows up only if the pool is disabled. This field is set with the time the pool was disabled at.

modified_on: String
networks: List[String]

List of networks where Load Balancer or Pool is enabled.

cloudflare_load_balancer_pool

resource "cloudflare_load_balancer_pool" "example_load_balancer_pool" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  name = "primary-dc-1"
  origins = [{
    address = "0.0.0.0"
    enabled = true
    header = {
      host = ["example.com"]
    }
    name = "app-server-1"
    port = 0
    virtual_network_id = "a5624d4e-044a-4ff0-b3e1-e2465353d4b4"
    weight = 0.6
  }]
  description = "Primary data center - Provider XYZ"
  enabled = false
  latitude = 0
  load_shedding = {
    default_percent = 0
    default_policy = "random"
    session_percent = 0
    session_policy = "hash"
  }
  longitude = 0
  minimum_origins = 0
  monitor = "monitor"
  monitor_group = "monitor_group"
  notification_email = "someone@example.com,sometwo@example.com"
  notification_filter = {
    origin = {
      disable = true
      healthy = true
    }
    pool = {
      disable = true
      healthy = false
    }
  }
  origin_steering = {
    policy = "random"
  }
}

data cloudflare_load_balancer_pool

required Expand Collapse
account_id: String

Identifier.

optional Expand Collapse
pool_id?: String
filter?: Attributes
monitor?: String

The ID of the Monitor to use for checking the health of origins within this pool.

computed Expand Collapse
id: String
created_on: String
description: String

A human-readable description of the pool.

disabled_at: Time

This field shows up only if the pool is disabled. This field is set with the time the pool was disabled at.

enabled: Bool

Whether to enable (the default) or disable 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).

latitude: Float64

The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.

longitude: Float64

The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.

minimum_origins: Int64

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 will failover to the next available pool.

modified_on: String
monitor: String

The ID of the Monitor to use for checking the health of origins within this pool.

monitor_group: String

The ID of the Monitor Group to use for checking the health of origins within this pool.

name: String

A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.

notification_email: String

This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. 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.

check_regions: List[String]

A list of regions from which to run health checks. Null means every Cloudflare data center.

networks: List[String]

List of networks where Load Balancer or Pool is enabled.

load_shedding: Attributes

Configures load shedding policies and percentages for the pool.

default_percent: Float64

The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.

default_policy: String

The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.

session_percent: Float64

The percent of existing sessions to shed from the pool, according to the session policy.

session_policy: String

Only the hash policy is supported for existing sessions (to avoid exponential decay).

notification_filter: Attributes

Filter pool and origin health notifications by resource type or health status. Use null to reset.

origin: Attributes

Filter options for a particular resource type (pool or origin). Use null to reset.

disable: Bool

If set true, disable notifications for this type of resource (pool or origin).

healthy: Bool

If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).

pool: Attributes

Filter options for a particular resource type (pool or origin). Use null to reset.

disable: Bool

If set true, disable notifications for this type of resource (pool or origin).

healthy: Bool

If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).

origin_steering: Attributes

Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.

policy: String

The type of origin steering policy to use.

  • "random": Select an origin randomly.
  • "hash": Select an origin by computing a hash over the CF-Connecting-IP address.
  • "least_outstanding_requests": Select 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.
  • "least_connections": Select 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.
origins: Set[Attributes]

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.

address: String

The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set.

disabled_at: Time

This field shows up only if the origin is disabled. This field is set with the time the origin was disabled.

enabled: Bool

Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool.

header: Attributes

The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.

host: List[String]

The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin.

name: String

A human-identifiable name for the origin.

port: Int64

The port for upstream connections. A value of 0 means the default port for the protocol will be used.

virtual_network_id: String

The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account.

weight: Float64

The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool.

  • origin_steering.policy="least_outstanding_requests": Use weight to scale the origin's outstanding requests.
  • origin_steering.policy="least_connections": Use weight to scale the origin's open connections.

cloudflare_load_balancer_pool

data "cloudflare_load_balancer_pool" "example_load_balancer_pool" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  pool_id = "17b5962d775c646f3f9725cbc7a53df4"
}

data cloudflare_load_balancer_pools

required Expand Collapse
account_id: String

Identifier.

optional Expand Collapse
monitor?: String

The ID of the Monitor to use for checking the health of origins within this pool.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String
check_regions: List[String]

A list of regions from which to run health checks. Null means every Cloudflare data center.

created_on: String
description: String

A human-readable description of the pool.

disabled_at: Time

This field shows up only if the pool is disabled. This field is set with the time the pool was disabled at.

enabled: Bool

Whether to enable (the default) or disable 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).

latitude: Float64

The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.

load_shedding: Attributes

Configures load shedding policies and percentages for the pool.

default_percent: Float64

The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.

default_policy: String

The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.

session_percent: Float64

The percent of existing sessions to shed from the pool, according to the session policy.

session_policy: String

Only the hash policy is supported for existing sessions (to avoid exponential decay).

longitude: Float64

The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.

minimum_origins: Int64

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 will failover to the next available pool.

modified_on: String
monitor: String

The ID of the Monitor to use for checking the health of origins within this pool.

monitor_group: String

The ID of the Monitor Group to use for checking the health of origins within this pool.

name: String

A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.

networks: List[String]

List of networks where Load Balancer or Pool is enabled.

notification_email: String

This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. 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.

notification_filter: Attributes

Filter pool and origin health notifications by resource type or health status. Use null to reset.

origin: Attributes

Filter options for a particular resource type (pool or origin). Use null to reset.

disable: Bool

If set true, disable notifications for this type of resource (pool or origin).

healthy: Bool

If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).

pool: Attributes

Filter options for a particular resource type (pool or origin). Use null to reset.

disable: Bool

If set true, disable notifications for this type of resource (pool or origin).

healthy: Bool

If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).

origin_steering: Attributes

Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.

policy: String

The type of origin steering policy to use.

  • "random": Select an origin randomly.
  • "hash": Select an origin by computing a hash over the CF-Connecting-IP address.
  • "least_outstanding_requests": Select 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.
  • "least_connections": Select 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.
origins: Set[Attributes]

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.

address: String

The IP address (IPv4 or IPv6) of the origin, or its publicly addressable hostname. Hostnames entered here should resolve directly to the origin, and not be a hostname proxied by Cloudflare. To set an internal/reserved address, virtual_network_id must also be set.

disabled_at: Time

This field shows up only if the origin is disabled. This field is set with the time the origin was disabled.

enabled: Bool

Whether to enable (the default) this origin within the pool. Disabled origins will not receive traffic and are excluded from health checks. The origin will only be disabled for the current pool.

header: Attributes

The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.

host: List[String]

The 'Host' header allows to override the hostname set in the HTTP request. Current support is 1 'Host' header override per origin.

name: String

A human-identifiable name for the origin.

port: Int64

The port for upstream connections. A value of 0 means the default port for the protocol will be used.

virtual_network_id: String

The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account.

weight: Float64

The weight of this origin relative to other origins in the pool. Based on the configured weight the total traffic is distributed among origins within the pool.

  • origin_steering.policy="least_outstanding_requests": Use weight to scale the origin's outstanding requests.
  • origin_steering.policy="least_connections": Use weight to scale the origin's open connections.

cloudflare_load_balancer_pools

data "cloudflare_load_balancer_pools" "example_load_balancer_pools" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  monitor = "monitor"
}