Table: cloudflare_load_balancer - Query Cloudflare Load Balancers using SQL
Cloudflare Load Balancers are part of Cloudflare's performance and reliability services. They distribute network or application traffic across many resources, effectively reducing the burden on any single resource and ensuring optimal resource utilization. They also provide health checks and failover support, enhancing the reliability of your services.
Table Usage Guide
The cloudflare_load_balancer
table provides insights into the load balancing configurations and health status within Cloudflare. As a network administrator or a DevOps engineer, you can explore load balancer-specific details through this table, including the traffic distribution, failover configurations, and associated metadata. Utilize it to uncover information about your load balancers, such as their health status, the resources they are balancing, and their failover configurations.
Examples
Basic info
Explore the setup of your load balancers in Cloudflare to understand their configuration and creation details, which can help in assessing their performance and identifying potential areas for optimization.
select name, id, zone_name, zone_id, created_on, ttl, steering_policyfrom cloudflare_load_balancer;
select name, id, zone_name, zone_id, created_on, ttl, steering_policyfrom cloudflare_load_balancer;
List proxied load balancers
Explore which load balancers are set to be proxied. This can be useful to determine the areas in your network that may be susceptible to certain security risks or performance issues.
select name, zone_id, ttlfrom cloudflare_load_balancerwhere proxied;
select name, zone_id, ttlfrom cloudflare_load_balancerwhere proxied = 1;
Get session_affinity details for load balancers
Analyze the settings to understand the session affinity details of your load balancers. This can provide insights into how your web traffic is distributed and managed across multiple servers, aiding in efficient load balancing.
select name, zone_name, session_affinity, session_affinity_ttl, jsonb_pretty(session_affinity_attributes) as session_affinity_attributesfrom cloudflare_load_balancer;
select name, zone_name, session_affinity, session_affinity_ttl, session_affinity_attributesfrom cloudflare_load_balancer;
Schema for cloudflare_load_balancer
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
created_on | timestamp with time zone | Load balancer creation time. | |
default_pools | jsonb | 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 | text | Load balancer description. | |
enabled | boolean | Whether to enable (the default) this load balancer. | |
fallback_pool | text | The pool ID to use when all other pools are detected as unhealthy. | |
id | text | API item identifier. | |
modified_on | timestamp with time zone | Last modification time. | |
name | text | The DNS hostname to associate with your Load Balancer. | |
pop_pools | jsonb | A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). This feature is only available to enterprise customers. | |
proxied | boolean | Whether the hostname gets Cloudflare's origin protection. Defaults to false. | |
region_pools | jsonb | A mapping of region/country 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. | |
session_affinity | text | The session_affinity specifies the type of session affinity the loadbalancer should use unless specified as "none" or ""(default). The supported types are "cookie" and "ip_cookie". | |
session_affinity_attributes | jsonb | session affinity cookie attributes. | |
session_affinity_ttl | bigint | Time, in seconds, until this load balancers session affinity cookie expires after being created. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
steering_policy | text | Determine which method the load balancer uses to determine the fastest route to your origin. Valid values are: "off", "geo", "dynamic_latency", "random", "proximity" or "". Default is "". | |
ttl | bigint | 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. | |
user_id | text | =, !=, ~~, ~~*, !~~, !~~* | ID of the current user. |
zone_id | text | The zone ID to which load balancer belongs. | |
zone_name | text | The zone name to which load balancer belongs. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- cloudflare
You can pass the configuration to the command with the --config
argument:
steampipe_export_cloudflare --config '<your_config>' cloudflare_load_balancer