turbot/cloudflare
steampipe plugin install cloudflare

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_policy
from
cloudflare_load_balancer;
select
name,
id,
zone_name,
zone_id,
created_on,
ttl,
steering_policy
from
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,
ttl
from
cloudflare_load_balancer
where
proxied;
select
name,
zone_id,
ttl
from
cloudflare_load_balancer
where
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_attributes
from
cloudflare_load_balancer;
select
name,
zone_name,
session_affinity,
session_affinity_ttl,
session_affinity_attributes
from
cloudflare_load_balancer;

Schema for cloudflare_load_balancer

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
created_ontimestamp with time zoneLoad balancer creation time.
default_poolsjsonbA 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.
descriptiontextLoad balancer description.
enabledbooleanWhether to enable (the default) this load balancer.
fallback_pooltextThe pool ID to use when all other pools are detected as unhealthy.
idtextAPI item identifier.
modified_ontimestamp with time zoneLast modification time.
nametextThe DNS hostname to associate with your Load Balancer.
pop_poolsjsonbA 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.
proxiedbooleanWhether the hostname gets Cloudflare's origin protection. Defaults to false.
region_poolsjsonbA 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_affinitytextThe 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_attributesjsonbsession affinity cookie attributes.
session_affinity_ttlbigintTime, in seconds, until this load balancers session affinity cookie expires after being created.
steering_policytextDetermine 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 "".
ttlbigintTime 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.
zone_idtextThe zone ID to which load balancer belongs.
zone_nametextThe 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