Skip to main content

Cloudflare/load Balancing

@swamp/cloudflare/load-balancingv2026.05.22.1· 1d agoMODELS
01README

Cloudflare load-balancing infrastructure models

02Release Notes
  • Added: healthchecks
  • Added: preview
  • Added: load_balancers
  • Added: monitor_groups
  • Added: monitors
  • Added: pools
03Models6
@swamp/cloudflare/load-balancing/healthchecksv2026.05.22.1healthchecks.ts

Global Arguments

ArgumentTypeDescription
zone_idstringCloudflare zone ID
addressstringThe hostname or IP address of the origin server to run health checks on.
check_regions?arrayA list of regions from which to run health checks. Null means Cloudflare will pick a default region.
consecutive_fails?numberThe number of consecutive fails required from a health check before changing the health to unhealthy.
consecutive_successes?numberThe number of consecutive successes required from a health check before changing the health to healthy.
description?stringA human-readable description of the health check.
http_config?objectParameters specific to an HTTP or HTTPS health check.
interval?numberThe 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.
namestringA short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.
retries?numberThe number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
suspended?booleanIf suspended, no health checks are sent to the origin.
tcp_config?objectParameters specific to TCP health check.
timeout?numberThe timeout (in seconds) before marking the health check as failed.
type?stringThe protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.
fn create()
Create a Healthchecks
fn get(id: string)
Get a Healthchecks
ArgumentTypeDescription
idstringThe ID of the Healthchecks
fn update()
Update Healthchecks attributes
fn delete(id: string)
Delete the Healthchecks
ArgumentTypeDescription
idstringThe ID of the Healthchecks
fn sync()
Sync Healthchecks state from Cloudflare

Resources

state(infinite)— Healthchecks resource state
@swamp/cloudflare/load-balancing/load-balancersv2026.05.22.1load_balancers.ts

Global Arguments

ArgumentTypeDescription
zone_idstringCloudflare zone ID
adaptive_routing?objectControls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin.
country_pools?recordA mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools.
default_poolsarrayA list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.
description?stringObject description.
enabled?booleanWhether to enable (the default) this load balancer.
fallback_poolstringThe pool ID to use when all other pools are detected as unhealthy.
location_strategy?objectControls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected.
namestringThe DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.
pop_pools?recordEnterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools.
proxied?booleanWhether the hostname should be gray clouded (false) or orange clouded (true).
random_steering?objectConfigures pool weights.\n- `steering_policy="random"`: A random pool is selected with probability proportional to pool weights.\n- `steering_policy="least_outstanding_requests"`: Use pool weights to scale each pool\
region_pools?recordA mapping of region codes to a list of pool IDs (ordered by their failover priority) for the given region. Any regions not explicitly defined will fall back to using default_pools.
rules?arrayBETA Field Not General Access: A list of rules for this load balancer to execute.
session_affinity?enumSpecifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has
session_affinity_attributes?objectConfigures attributes for session affinity.
session_affinity_ttl?numberTime, in seconds, until a client\
steering_policy?enumSteering Policy for this load balancer.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"proximity"`: Use the pools\
ttl?numberTime to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.
networks?arrayList of networks where Load Balancer or Pool is enabled.
fn create()
Create a Load Balancers
fn get(id: string)
Get a Load Balancers
ArgumentTypeDescription
idstringThe ID of the Load Balancers
fn update()
Update Load Balancers attributes
fn delete(id: string)
Delete the Load Balancers
ArgumentTypeDescription
idstringThe ID of the Load Balancers
fn sync()
Sync Load Balancers state from Cloudflare

Resources

state(infinite)— Load Balancers resource state
@swamp/cloudflare/load-balancing/monitor-groupsv2026.05.22.1monitor_groups.ts

Global Arguments

ArgumentTypeDescription
account_idstringCloudflare account ID
created_on?stringThe timestamp of when the monitor group was created
descriptionstringA short description of the monitor group
idstringThe ID of the Monitor Group to use for checking the health of origins within this pool.
membersarrayList of monitors in this group
modified_on?stringThe timestamp of when the monitor group was last updated
fn create()
Create a Monitor Groups
fn get(id: string)
Get a Monitor Groups
ArgumentTypeDescription
idstringThe ID of the Monitor Groups
fn update()
Update Monitor Groups attributes
fn delete(id: string)
Delete the Monitor Groups
ArgumentTypeDescription
idstringThe ID of the Monitor Groups
fn sync()
Sync Monitor Groups state from Cloudflare

Resources

state(infinite)— Monitor Groups resource state
@swamp/cloudflare/load-balancing/monitorsv2026.05.22.1monitors.ts

Global Arguments

ArgumentTypeDescription
account_idstringCloudflare account ID
allow_insecure?booleanDo not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.
consecutive_down?numberTo be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.
consecutive_up?numberTo be marked healthy the monitored origin must pass this healthcheck N consecutive times.
description?stringObject description.
expected_body?stringA case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.
expected_codes?stringThe expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.
follow_redirects?booleanFollow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.
header?recordThe HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors.
interval?numberThe interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.
method?stringThe method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.
path?stringThe endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.
port?numberThe port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).
probe_zone?stringAssign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.
retries?numberThe number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
timeout?numberThe timeout (in seconds) before marking the health check as failed.
type?enumThe protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
fn create()
Create a Monitors
fn get(id: string)
Get a Monitors
ArgumentTypeDescription
idstringThe ID of the Monitors
fn update()
Update Monitors attributes
fn delete(id: string)
Delete the Monitors
ArgumentTypeDescription
idstringThe ID of the Monitors
fn sync()
Sync Monitors state from Cloudflare

Resources

state(infinite)— Monitors resource state
@swamp/cloudflare/load-balancing/poolsv2026.05.22.1pools.ts

Global Arguments

ArgumentTypeDescription
account_idstringCloudflare account ID
check_regions?arrayA list of regions from which to run health checks. Null means every Cloudflare data center.
description?stringA human-readable description of the pool.
disabled_at?stringThis field shows up only if the pool is disabled. This field is set with the time the pool was disabled at.
enabled?booleanWhether 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?numberThe 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?objectConfigures load shedding policies and percentages for the pool.
longitude?numberThe 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?numberThe 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.
monitor?stringThe ID of the Monitor to use for checking the health of origins within this pool.
monitor_group?stringThe ID of the Monitor Group to use for checking the health of origins within this pool.
namestringA short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.
notification_email?stringThis 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?objectFilter pool and origin health notifications by resource type or health status. Use null to reset.
origin_steering?objectConfigures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.
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.
fn create()
Create a Pools
fn get(id: string)
Get a Pools
ArgumentTypeDescription
idstringThe ID of the Pools
fn update()
Update Pools attributes
fn delete(id: string)
Delete the Pools
ArgumentTypeDescription
idstringThe ID of the Pools
fn sync()
Sync Pools state from Cloudflare

Resources

state(infinite)— Pools resource state
@swamp/cloudflare/load-balancing/previewv2026.05.22.1preview.ts

Global Arguments

ArgumentTypeDescription
zone_idstringCloudflare zone ID
addressstringThe hostname or IP address of the origin server to run health checks on.
check_regions?arrayA list of regions from which to run health checks. Null means Cloudflare will pick a default region.
consecutive_fails?numberThe number of consecutive fails required from a health check before changing the health to unhealthy.
consecutive_successes?numberThe number of consecutive successes required from a health check before changing the health to healthy.
description?stringA human-readable description of the health check.
http_config?objectParameters specific to an HTTP or HTTPS health check.
interval?numberThe 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.
namestringA short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.
retries?numberThe number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
suspended?booleanIf suspended, no health checks are sent to the origin.
tcp_config?objectParameters specific to TCP health check.
timeout?numberThe timeout (in seconds) before marking the health check as failed.
type?stringThe protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.
fn create()
Create a Preview
fn get(id: string)
Get a Preview
ArgumentTypeDescription
idstringThe ID of the Preview
fn delete(id: string)
Delete the Preview
ArgumentTypeDescription
idstringThe ID of the Preview
fn sync()
Sync Preview state from Cloudflare

Resources

state(infinite)— Preview resource state
04Stats
A
100 / 100
Downloads
0
Archive size
32.0 KB
Verified by Swamp
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
05Platforms
06Labels