Skip to main content

pools

Creates, updates, deletes, gets or lists a pools resource.

Overview

Namepools
TypeResource
Idcloudflare.load_balancers.pools

Fields

The following fields are returned by SELECT queries:

Pool Details response.

NameDatatypeDescription
idstring (example: 17b5962d775c646f3f9725cbc7a53df4)
namestringA short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. (example: primary-dc-1)
check_regionsarrayA list of regions from which to run health checks. Null means every Cloudflare data center.
created_onstring (example: 2014-01-01T05:20:00.12345Z)
descriptionstringA human-readable description of the pool. (default: , example: Primary data center - Provider XYZ)
disabled_atstring (date-time)This field shows up only if the pool is disabled. This field is set with the time the pool was disabled at.
enabledbooleanWhether 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).
latitudenumberThe 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_sheddingobjectConfigures load shedding policies and percentages for the pool. (x-stainless-terraform-configurability: computed_optional)
longitudenumberThe 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_originsintegerThe 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_onstring (example: 2014-01-01T05:20:00.12345Z)
monitorstringThe ID of the Monitor to use for checking the health of origins within this pool.
monitor_groupstringThe ID of the Monitor Group to use for checking the health of origins within this pool.
networksarrayList of networks where Load Balancer or Pool is enabled.
notification_emailstringThis 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. (default: , example: someone@example.com,sometwo@example.com)
notification_filterobjectFilter pool and origin health notifications by resource type or health status. Use null to reset. (x-stainless-terraform-configurability: computed_optional)
origin_steeringobjectConfigures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity. (x-stainless-terraform-configurability: computed_optional)
originsarrayThe list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. (x-stainless-collection-type: set)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_accountselectpool_id, account_idFetch a single configured pool.
list_by_accountselectaccount_idmonitorList configured pools.
get_by_userselectpool_idFetch a single configured pool.
list_by_userselectmonitorList configured pools.
createinsertaccount_id, origins, nameCreate a new pool.
load_balancer_pools_create_poolinsertorigins, nameCreate a new pool.
editupdatepool_id, account_idApply changes to an existing pool, overwriting the supplied properties.
account_load_balancer_pools_patch_poolsupdateaccount_idApply changes to a number of existing pools, overwriting the supplied properties. Pools are ordered by ascending name. Returns the list of affected pools. Supports the standard pagination query parameters, either limit/offset or per_page/page.
load_balancer_pools_patch_poolupdatepool_idApply changes to an existing pool, overwriting the supplied properties.
load_balancer_pools_patch_poolsupdateApply changes to a number of existing pools, overwriting the supplied properties. Pools are ordered by ascending name. Returns the list of affected pools. Supports the standard pagination query parameters, either limit/offset or per_page/page.
updatereplacepool_id, account_id, origins, nameModify a configured pool.
load_balancer_pools_update_poolreplacepool_id, origins, nameModify a configured pool.
deletedeletepool_id, account_idDelete a configured pool.
load_balancer_pools_delete_pooldeletepool_idDelete a configured pool.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
pool_idstringThe Load Balancer pool ID.
monitorstring

SELECT examples

Fetch a single configured pool.

SELECT
id,
name,
check_regions,
created_on,
description,
disabled_at,
enabled,
latitude,
load_shedding,
longitude,
minimum_origins,
modified_on,
monitor,
monitor_group,
networks,
notification_email,
notification_filter,
origin_steering,
origins
FROM cloudflare.load_balancers.pools
WHERE pool_id = '{{ pool_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;

INSERT examples

Create a new pool.

INSERT INTO cloudflare.load_balancers.pools (
description,
enabled,
latitude,
load_shedding,
longitude,
minimum_origins,
monitor,
monitor_group,
name,
notification_email,
notification_filter,
origin_steering,
origins,
account_id
)
SELECT
'{{ description }}',
{{ enabled }},
{{ latitude }},
'{{ load_shedding }}',
{{ longitude }},
{{ minimum_origins }},
'{{ monitor }}',
'{{ monitor_group }}',
'{{ name }}' /* required */,
'{{ notification_email }}',
'{{ notification_filter }}',
'{{ origin_steering }}',
'{{ origins }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Apply changes to an existing pool, overwriting the supplied properties.

UPDATE cloudflare.load_balancers.pools
SET
check_regions = '{{ check_regions }}',
description = '{{ description }}',
enabled = {{ enabled }},
latitude = {{ latitude }},
load_shedding = '{{ load_shedding }}',
longitude = {{ longitude }},
minimum_origins = {{ minimum_origins }},
monitor = '{{ monitor }}',
monitor_group = '{{ monitor_group }}',
name = '{{ name }}',
notification_email = '{{ notification_email }}',
notification_filter = '{{ notification_filter }}',
origin_steering = '{{ origin_steering }}',
origins = '{{ origins }}'
WHERE
pool_id = '{{ pool_id }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;

REPLACE examples

Modify a configured pool.

REPLACE cloudflare.load_balancers.pools
SET
check_regions = '{{ check_regions }}',
description = '{{ description }}',
enabled = {{ enabled }},
latitude = {{ latitude }},
load_shedding = '{{ load_shedding }}',
longitude = {{ longitude }},
minimum_origins = {{ minimum_origins }},
monitor = '{{ monitor }}',
monitor_group = '{{ monitor_group }}',
name = '{{ name }}',
notification_email = '{{ notification_email }}',
notification_filter = '{{ notification_filter }}',
origin_steering = '{{ origin_steering }}',
origins = '{{ origins }}'
WHERE
pool_id = '{{ pool_id }}' --required
AND account_id = '{{ account_id }}' --required
AND origins = '{{ origins }}' --required
AND name = '{{ name }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Delete a configured pool.

DELETE FROM cloudflare.load_balancers.pools
WHERE pool_id = '{{ pool_id }}' --required
AND account_id = '{{ account_id }}' --required
;