steampipe plugin install fastly

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_version
from
fastly_backend;
select
name,
address,
port,
use_ssl,
auto_loadbalance,
created_at,
service_id,
service_version
from
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_version
from
fastly_backend
where
deleted_at is null;
select
name,
address,
port,
use_ssl,
auto_loadbalance,
created_at,
service_id,
service_version
from
fastly_backend
where
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_version
from
fastly_backend
where
use_ssl;
select
name,
address,
port,
use_ssl,
auto_loadbalance,
created_at,
service_id,
service_version
from
fastly_backend
where
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_version
from
fastly_backend
where
auto_loadbalance;
select
name,
address,
port,
use_ssl,
auto_loadbalance,
created_at,
service_id,
service_version
from
fastly_backend
where
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_version
from
fastly_backend as b,
fastly_service as s
where
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_version
from
fastly_backend as b,
fastly_service as s
where
b.service_id = s.id
and s.name = 'check-service';

Schema for fastly_backend

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
addresstextA hostname, IPv4, or IPv6 address for the backend. This is the preferred way to specify the location of your backend.
auto_loadbalancebooleanWhether 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_timeoutbigintMaximum 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.
commenttextA freeform descriptive note.
connect_timeoutbigintMaximum 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_attimestamp with time zoneTimestamp (UTC) of when the backend was created.
deleted_attimestamp with time zoneTimestamp (UTC) of when the backend was deleted.
error_thresholdbigintThe error threshold of the backend.
first_byte_timeoutbigintMaximum 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_checktextThe name of the health check to use with this backend.
hostnametextThe hostname of the backend. May be used as an alternative to address to set the backend location.
keep_alive_timebigintKeep alive time of the backend.
max_connbigintMaximum number of concurrent connections this backend will accept.
max_tls_versiontextMaximum allowed TLS version on connections to this backend.
min_tls_versiontextMinimum allowed TLS version on connections to this backend.
nametext=The name of the backend.
override_hosttextIf 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.
portbigintPort 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_conditiontextName 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_idtextAlphanumeric string identifying the service.
service_versionbigintInteger identifying a service version.
shieldtextData center POP code of the data center to use as a shield.
ssl_ca_certtextCA certificate attached to origin.
ssl_cert_hostnametextOverrides ssl_hostname, but only for cert verification. Does not affect SNI at all.
ssl_check_certbooleanBe strict on checking SSL certs.
ssl_cipherstextList 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_certtextClient certificate attached to origin.
ssl_client_keytextClient key attached to origin.
ssl_hostnametextUse ssl_cert_hostname and ssl_sni_hostname to configure certificate validation.
ssl_sni_hostnametextOverrides ssl_hostname, but only for SNI in the handshake. Does not affect cert validation at all.
titletextTitle of the resource.
updated_attimestamp with time zoneTimestamp (UTC) of when the backend was updated.
use_sslbooleanWhether or not to require SSL for connections to this backend.
weightbigintWeight 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