Skip to main content

Cloudflare/load Balancing

@swamp/cloudflare/load-balancingv2026.08.15.1· 7d agoMODELS
01README

Cloudflare load-balancing infrastructure models

02Release Notes
  • Updated: pools
03Models6
@swamp/cloudflare/load-balancing/healthchecksv2026.07.21.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'.
apiToken?stringCloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault.
apiKey?stringCloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email.
email?stringCloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey.
fn create()
Create a Healthchecks
fn get(id: string)
Get a Healthchecks
ArgumentTypeDescription
idstringThe ID of the Healthchecks
fn lookup()
Look up an existing Healthchecks by matching global argument values and import it into state
fn adopt(id: string)
Import an existing Healthchecks by ID into state for management
ArgumentTypeDescription
idstringThe ID of the Healthchecks to import
fn update(identifier?: string)
Update Healthchecks attributes
ArgumentTypeDescription
identifier?stringTarget a specific Healthchecks by id (e.g. one discovered by list)
fn delete(id: string)
Delete the Healthchecks
ArgumentTypeDescription
idstringThe ID of the Healthchecks
fn sync(identifier?: string)
Sync Healthchecks state from Cloudflare
ArgumentTypeDescription
identifier?stringTarget a specific Healthchecks by id (e.g. one discovered by list)

Resources

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

Global Arguments

ArgumentTypeDescription
account_id?stringCloudflare account ID (provide account_id or zone_id)
zone_id?stringCloudflare zone ID (provide account_id or 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.
networks?arrayList of networks where Load Balancer or Pool is enabled.
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.
apiToken?stringCloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault.
apiKey?stringCloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email.
email?stringCloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey.
fn create()
Create a Load Balancers
fn get(id: string)
Get a Load Balancers
ArgumentTypeDescription
idstringThe ID of the Load Balancers
fn lookup()
Look up an existing Load Balancers by matching global argument values and import it into state
fn adopt(id: string)
Import an existing Load Balancers by ID into state for management
ArgumentTypeDescription
idstringThe ID of the Load Balancers to import
fn update(identifier?: string)
Update Load Balancers attributes
ArgumentTypeDescription
identifier?stringTarget a specific Load Balancers by id (e.g. one discovered by list)
fn delete(id: string)
Delete the Load Balancers
ArgumentTypeDescription
idstringThe ID of the Load Balancers
fn sync(identifier?: string)
Sync Load Balancers state from Cloudflare
ArgumentTypeDescription
identifier?stringTarget a specific Load Balancers by id (e.g. one discovered by list)

Resources

state(infinite)— Load Balancers resource state
@swamp/cloudflare/load-balancing/monitor-groupsv2026.07.21.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
apiToken?stringCloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault.
apiKey?stringCloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email.
email?stringCloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey.
fn create()
Create a Monitor Groups
fn get(id: string)
Get a Monitor Groups
ArgumentTypeDescription
idstringThe ID of the Monitor Groups
fn lookup()
Look up an existing Monitor Groups by matching global argument values and import it into state
fn adopt(id: string)
Import an existing Monitor Groups by ID into state for management
ArgumentTypeDescription
idstringThe ID of the Monitor Groups to import
fn update(identifier?: string)
Update Monitor Groups attributes
ArgumentTypeDescription
identifier?stringTarget a specific Monitor Groups by id (e.g. one discovered by list)
fn delete(id: string)
Delete the Monitor Groups
ArgumentTypeDescription
idstringThe ID of the Monitor Groups
fn sync(identifier?: string)
Sync Monitor Groups state from Cloudflare
ArgumentTypeDescription
identifier?stringTarget a specific Monitor Groups by id (e.g. one discovered by list)

Resources

state(infinite)— Monitor Groups resource state
@swamp/cloudflare/load-balancing/monitorsv2026.07.21.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'.
apiToken?stringCloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault.
apiKey?stringCloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email.
email?stringCloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey.
fn create()
Create a Monitors
fn get(id: string)
Get a Monitors
ArgumentTypeDescription
idstringThe ID of the Monitors
fn lookup()
Look up an existing Monitors by matching global argument values and import it into state
fn adopt(id: string)
Import an existing Monitors by ID into state for management
ArgumentTypeDescription
idstringThe ID of the Monitors to import
fn update(identifier?: string)
Update Monitors attributes
ArgumentTypeDescription
identifier?stringTarget a specific Monitors by id (e.g. one discovered by list)
fn delete(id: string)
Delete the Monitors
ArgumentTypeDescription
idstringThe ID of the Monitors
fn sync(identifier?: string)
Sync Monitors state from Cloudflare
ArgumentTypeDescription
identifier?stringTarget a specific Monitors by id (e.g. one discovered by list)

Resources

state(infinite)— Monitors resource state
@swamp/cloudflare/load-balancing/poolsv2026.08.15.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).
health_sources?arrayA list of health sources, ordered from highest to lowest priority, used to evaluate individual origin health and overall pool health. The load balancer uses the first source that has data and falls back to the next. Currently accepted values are null or the exact array ["regional", "global"]; any other combination is rejected. Null (the default) behaves like ["local", "global"]. ["regional", "global"] makes each region steer on its own health, falling back to the global decision when a region ha
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.
apiToken?stringCloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault.
apiKey?stringCloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email.
email?stringCloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey.
fn create()
Create a Pools
fn get(id: string)
Get a Pools
ArgumentTypeDescription
idstringThe ID of the Pools
fn lookup()
Look up an existing Pools by matching global argument values and import it into state
fn adopt(id: string)
Import an existing Pools by ID into state for management
ArgumentTypeDescription
idstringThe ID of the Pools to import
fn update(identifier?: string)
Update Pools attributes
ArgumentTypeDescription
identifier?stringTarget a specific Pools by id (e.g. one discovered by list)
fn delete(id: string)
Delete the Pools
ArgumentTypeDescription
idstringThe ID of the Pools
fn sync(identifier?: string)
Sync Pools state from Cloudflare
ArgumentTypeDescription
identifier?stringTarget a specific Pools by id (e.g. one discovered by list)

Resources

state(infinite)— Pools resource state
@swamp/cloudflare/load-balancing/previewv2026.07.21.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'.
apiToken?stringCloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault.
apiKey?stringCloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email.
email?stringCloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey.
fn create()
Create a Preview
fn get(id: string)
Get a Preview
ArgumentTypeDescription
idstringThe ID of the Preview
fn lookup()
Look up an existing Preview by matching global argument values and import it into state
fn adopt(id: string)
Import an existing Preview by ID into state for management
ArgumentTypeDescription
idstringThe ID of the Preview to import
fn delete(id: string)
Delete the Preview
ArgumentTypeDescription
idstringThe ID of the Preview
fn sync(identifier?: string)
Sync Preview state from Cloudflare
ArgumentTypeDescription
identifier?stringTarget a specific Preview by id (e.g. one discovered by list)

Resources

state(infinite)— Preview resource state
04Previous Versions8
2026.07.24.1
  • Updated: load_balancers
2026.07.21.1
  • Updated: healthchecks
  • Updated: preview
  • Updated: load_balancers
  • Updated: monitor_groups
  • Updated: monitors
  • Updated: pools
2026.07.18.2

Modified 6 models

2026.07.16.1
  • Updated: load_balancers
2026.07.14.1
  • Updated: load_balancers
2026.06.08.2
  • Updated: healthchecks
  • Updated: preview
  • Updated: load_balancers
  • Updated: monitor_groups
  • Updated: monitors
  • Updated: pools
2026.05.29.1
  • Updated: healthchecks
  • Updated: preview
  • Updated: load_balancers
  • Updated: monitor_groups
  • Updated: monitors
  • Updated: pools
2026.05.22.1
  • Added: healthchecks
  • Added: preview
  • Added: load_balancers
  • Added: monitor_groups
  • Added: monitors
  • Added: pools
05Stats
A
100 / 100
Downloads
0
Archive size
50.3 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 types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms
07Labels