Table: fastly_backend - Query Fastly Backends using SQL
A Fastly Backend represents an origin server to which Fastly will connect to fetch content. Backends are defined in the configuration for a Fastly service and are associated with a specific service and version. They provide the critical link between Fastly and the origin server, defining how Fastly connects to the origin to fetch the content it will cache and deliver.
Table Usage Guide
The fastly_backend
table provides insights into the configuration and status of backends within Fastly's edge cloud platform. As an infrastructure engineer, explore backend-specific details through this table, including the service it is associated with, its version, and its connection details. Utilize it to uncover information about backends, such as the connection timeouts, max connections, and the healthcheck parameters.
Examples
Basic info
Explore the configuration of your backend servers on Fastly to understand their security settings, load balancing status, and creation dates. This can help you assess your current setup and identify areas for potential improvement or troubleshooting.
select name, address, port, use_ssl, auto_loadbalance, created_at, service_id, service_versionfrom fastly_backend;
select name, address, port, use_ssl, auto_loadbalance, created_at, service_id, service_versionfrom fastly_backend;
List all backends that are not deleted
Discover the segments that contain all active backends in your Fastly service. This information is useful for maintaining an overview of your current operational infrastructure and understanding the configuration of each backend.
select name, address, port, use_ssl, auto_loadbalance, created_at, service_id, service_versionfrom fastly_backendwhere deleted_at is null;
select name, address, port, use_ssl, auto_loadbalance, created_at, service_id, service_versionfrom fastly_backendwhere deleted_at is null;
List all backends that are using SSL
Discover the segments that are utilizing SSL for secure communication, which can be crucial for maintaining data privacy and enhancing security measures. This can be particularly useful in identifying and managing secure backends in your network infrastructure.
select name, address, port, use_ssl, auto_loadbalance, created_at, service_id, service_versionfrom fastly_backendwhere use_ssl;
select name, address, port, use_ssl, auto_loadbalance, created_at, service_id, service_versionfrom fastly_backendwhere use_ssl = 1;
List all backends where auto load balance is enabled
Discover the segments that are auto load balanced in your backends. This is useful for identifying areas where load distribution is automated, allowing for efficient resource management.
select name, address, port, use_ssl, auto_loadbalance, created_at, service_id, service_versionfrom fastly_backendwhere auto_loadbalance;
select name, address, port, use_ssl, auto_loadbalance, created_at, service_id, service_versionfrom fastly_backendwhere auto_loadbalance = 1;
List backends for a particular service
Uncover the details of specific backends associated with a particular service in Fastly. This is useful for understanding the configuration and settings of the backends, including whether they use SSL, auto load balance, their address, and port, providing insights into the service's operation and performance.
select b.name, address, port, use_ssl, auto_loadbalance, b.created_at, service_id, service_versionfrom fastly_backend as b, fastly_service as swhere b.service_id = s.id and s.name = 'check-service';
select b.name, address, port, use_ssl, auto_loadbalance, b.created_at, service_id, service_versionfrom fastly_backend as b, fastly_service as swhere b.service_id = s.id and s.name = 'check-service';
Schema for fastly_backend
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
address | text | A hostname, IPv4, or IPv6 address for the backend. This is the preferred way to specify the location of your backend. | |
auto_loadbalance | boolean | Whether or not this backend should be automatically load balanced. If true, all backends with this setting that don't have a request_condition will be selected based on their weight. | |
between_bytes_timeout | bigint | Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. | |
comment | text | A freeform descriptive note. | |
connect_timeout | bigint | Maximum duration in milliseconds to wait for a connection to this backend to be established. If exceeded, the connection is aborted and a synthethic 503 response will be presented instead. | |
created_at | timestamp with time zone | Timestamp (UTC) of when the backend was created. | |
deleted_at | timestamp with time zone | Timestamp (UTC) of when the backend was deleted. | |
error_threshold | bigint | The error threshold of the backend. | |
first_byte_timeout | bigint | Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. If exceeded, the connection is aborted and a synthethic 503 response will be presented instead. | |
health_check | text | The name of the health check to use with this backend. | |
hostname | text | The hostname of the backend. May be used as an alternative to address to set the backend location. | |
keep_alive_time | bigint | Keep alive time of the backend. | |
max_conn | bigint | Maximum number of concurrent connections this backend will accept. | |
max_tls_version | text | Maximum allowed TLS version on connections to this backend. | |
min_tls_version | text | Minimum allowed TLS version on connections to this backend. | |
name | text | = | The name of the backend. |
override_host | text | If set, will replace the client-supplied HTTP Host header on connections to this backend. Applied after VCL has been processed, so this setting will take precedence over changing bereq.http.Host in VCL. | |
port | bigint | Port on which the backend server is listening for connections from Fastly. Setting port to 80 or 443 will also set use_ssl automatically (to false and true respectively), unless explicitly overridden by setting use_ssl in the same request. | |
request_condition | text | Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any auto_loadbalance setting. By default, the first backend added to a service is selected for all requests. | |
service_id | text | Alphanumeric string identifying the service. | |
service_version | bigint | Integer identifying a service version. | |
shield | text | Data center POP code of the data center to use as a shield. | |
ssl_ca_cert | text | CA certificate attached to origin. | |
ssl_cert_hostname | text | Overrides ssl_hostname, but only for cert verification. Does not affect SNI at all. | |
ssl_check_cert | boolean | Be strict on checking SSL certs. | |
ssl_ciphers | text | List of OpenSSL ciphers to support for connections to this origin. If your backend server is not able to negotiate a connection meeting this constraint, a synthetic 503 error response will be generated. | |
ssl_client_cert | text | Client certificate attached to origin. | |
ssl_client_key | text | Client key attached to origin. | |
ssl_hostname | text | Use ssl_cert_hostname and ssl_sni_hostname to configure certificate validation. | |
ssl_sni_hostname | text | Overrides ssl_hostname, but only for SNI in the handshake. Does not affect cert validation at all. | |
title | text | Title of the resource. | |
updated_at | timestamp with time zone | Timestamp (UTC) of when the backend was updated. | |
use_ssl | boolean | Whether or not to require SSL for connections to this backend. | |
weight | bigint | Weight used to load balance this backend against others. May be any positive integer. If auto_loadbalance is true, the chance of this backend being selected is equal to its own weight over the sum of all weights for backends that have auto_loadbalance set to true. |
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)" -- fastly
You can pass the configuration to the command with the --config
argument:
steampipe_export_fastly --config '<your_config>' fastly_backend