Cloudflare/load Balancing
@swamp/cloudflare/load-balancingv2026.05.22.1
01README
Cloudflare load-balancing infrastructure models
02Release Notes
- Added: healthchecks
- Added: preview
- Added: load_balancers
- Added: monitor_groups
- Added: monitors
- Added: pools
03Models
@swamp/cloudflare/load-balancing/healthchecksv2026.05.22.1healthchecks.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| zone_id | string | Cloudflare zone ID |
| address | string | The hostname or IP address of the origin server to run health checks on. |
| check_regions? | array | A list of regions from which to run health checks. Null means Cloudflare will pick a default region. |
| consecutive_fails? | number | The number of consecutive fails required from a health check before changing the health to unhealthy. |
| consecutive_successes? | number | The number of consecutive successes required from a health check before changing the health to healthy. |
| description? | string | A human-readable description of the health check. |
| http_config? | object | Parameters specific to an HTTP or HTTPS health check. |
| interval? | number | The 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. |
| name | string | A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. |
| retries? | number | The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. |
| suspended? | boolean | If suspended, no health checks are sent to the origin. |
| tcp_config? | object | Parameters specific to TCP health check. |
| timeout? | number | The timeout (in seconds) before marking the health check as failed. |
| type? | string | The 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
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Healthchecks |
fn update()
Update Healthchecks attributes
fn delete(id: string)
Delete the Healthchecks
| Argument | Type | Description |
|---|---|---|
| id | string | The 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
| Argument | Type | Description |
|---|---|---|
| zone_id | string | Cloudflare zone ID |
| adaptive_routing? | object | Controls 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? | record | A 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_pools | array | A 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? | string | Object description. |
| enabled? | boolean | Whether to enable (the default) this load balancer. |
| fallback_pool | string | The pool ID to use when all other pools are detected as unhealthy. |
| location_strategy? | object | Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected. |
| name | string | The 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? | record | Enterprise 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? | boolean | Whether the hostname should be gray clouded (false) or orange clouded (true). |
| random_steering? | object | Configures 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? | record | A 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? | array | BETA Field Not General Access: A list of rules for this load balancer to execute. |
| session_affinity? | enum | Specifies 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? | object | Configures attributes for session affinity. |
| session_affinity_ttl? | number | Time, in seconds, until a client\ |
| steering_policy? | enum | Steering 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? | number | Time 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? | array | List of networks where Load Balancer or Pool is enabled. |
fn create()
Create a Load Balancers
fn get(id: string)
Get a Load Balancers
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Load Balancers |
fn update()
Update Load Balancers attributes
fn delete(id: string)
Delete the Load Balancers
| Argument | Type | Description |
|---|---|---|
| id | string | The 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
| Argument | Type | Description |
|---|---|---|
| account_id | string | Cloudflare account ID |
| created_on? | string | The timestamp of when the monitor group was created |
| description | string | A short description of the monitor group |
| id | string | The ID of the Monitor Group to use for checking the health of origins within this pool. |
| members | array | List of monitors in this group |
| modified_on? | string | The timestamp of when the monitor group was last updated |
fn create()
Create a Monitor Groups
fn get(id: string)
Get a Monitor Groups
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Monitor Groups |
fn update()
Update Monitor Groups attributes
fn delete(id: string)
Delete the Monitor Groups
| Argument | Type | Description |
|---|---|---|
| id | string | The 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
| Argument | Type | Description |
|---|---|---|
| account_id | string | Cloudflare account ID |
| allow_insecure? | boolean | Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. |
| consecutive_down? | number | To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. |
| consecutive_up? | number | To be marked healthy the monitored origin must pass this healthcheck N consecutive times. |
| description? | string | Object description. |
| expected_body? | string | A 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? | string | The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. |
| follow_redirects? | boolean | Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. |
| header? | record | The 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? | number | The 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? | string | The 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? | string | The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. |
| port? | number | The 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? | string | Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. |
| retries? | number | The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. |
| timeout? | number | The timeout (in seconds) before marking the health check as failed. |
| type? | enum | The 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
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Monitors |
fn update()
Update Monitors attributes
fn delete(id: string)
Delete the Monitors
| Argument | Type | Description |
|---|---|---|
| id | string | The 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
| Argument | Type | Description |
|---|---|---|
| account_id | string | Cloudflare account ID |
| check_regions? | array | A list of regions from which to run health checks. Null means every Cloudflare data center. |
| description? | string | A human-readable description of the pool. |
| disabled_at? | string | This field shows up only if the pool is disabled. This field is set with the time the pool was disabled at. |
| enabled? | boolean | 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? | number | 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? | object | Configures load shedding policies and percentages for the pool. |
| longitude? | number | 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? | 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 will failover to the next available pool. |
| 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. |
| notification_filter? | object | Filter pool and origin health notifications by resource type or health status. Use null to reset. |
| origin_steering? | object | Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity. |
| origins | array | 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. |
fn create()
Create a Pools
fn get(id: string)
Get a Pools
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Pools |
fn update()
Update Pools attributes
fn delete(id: string)
Delete the Pools
| Argument | Type | Description |
|---|---|---|
| id | string | The 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
| Argument | Type | Description |
|---|---|---|
| zone_id | string | Cloudflare zone ID |
| address | string | The hostname or IP address of the origin server to run health checks on. |
| check_regions? | array | A list of regions from which to run health checks. Null means Cloudflare will pick a default region. |
| consecutive_fails? | number | The number of consecutive fails required from a health check before changing the health to unhealthy. |
| consecutive_successes? | number | The number of consecutive successes required from a health check before changing the health to healthy. |
| description? | string | A human-readable description of the health check. |
| http_config? | object | Parameters specific to an HTTP or HTTPS health check. |
| interval? | number | The 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. |
| name | string | A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed. |
| retries? | number | The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. |
| suspended? | boolean | If suspended, no health checks are sent to the origin. |
| tcp_config? | object | Parameters specific to TCP health check. |
| timeout? | number | The timeout (in seconds) before marking the health check as failed. |
| type? | string | The 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
| Argument | Type | Description |
|---|---|---|
| id | string | The ID of the Preview |
fn delete(id: string)
Delete the Preview
| Argument | Type | Description |
|---|---|---|
| id | string | The 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