steampipe plugin install gcp

Table: gcp_compute_backend_service - Query Google Cloud Compute Engine Backend Services using SQL

Google Cloud Compute Engine Backend Services are a part of Google Cloud's Load Balancing feature, providing a scalable, reliable, and efficient way to distribute traffic across various instances. They manage HTTP(S) Load Balancing by directing traffic to available instances based on the capacity and load of each instance. This service helps in optimizing resource utilization and minimizing latency.

Table Usage Guide

The gcp_compute_backend_service table provides insights into Google Cloud Compute Engine Backend Services. As a DevOps engineer, you can explore details about these services through this table, including their configurations, statuses, and associated instances. Utilize it to manage and monitor the distribution of traffic across your instances, ensuring optimal resource utilization and performance.

Examples

Backend info of backend service

Determine the areas in which your Google Cloud Compute backend service is balancing its workload, along with identifying the associated network endpoint groups. This can help you manage workload distribution and optimize network performance.

select
name,
id,
b ->> 'balancingMode' as balancing_mode,
split_part(b ->> 'group', '/', 10) as network_endpoint_groups
from
gcp_compute_backend_service,
jsonb_array_elements(backends) as b;
Error: The corresponding SQLite query is unavailable.

List of backend services where health check is not configured

Discover the segments that lack health check configurations within the Google Cloud Platform's backend services. This can help in identifying potential vulnerabilities and ensuring optimal performance of the services.

select
name,
id,
self_link,
health_checks
from
gcp_compute_backend_service
where
health_checks is null;
select
name,
id,
self_link,
health_checks
from
gcp_compute_backend_service
where
health_checks is null;

List of backend services where connection draining timeout is less than 300 sec

Determine the areas in which backend services may experience connection issues due to a draining timeout of less than 300 seconds. This can be useful for troubleshooting and optimizing network performance.

select
name,
id,
connection_draining_timeout_sec
from
gcp_compute_backend_service
where
connection_draining_timeout_sec < 300;
select
name,
id,
connection_draining_timeout_sec
from
gcp_compute_backend_service
where
connection_draining_timeout_sec < 300;

List of backend services where logging is not enabled

Discover the segments that have logging disabled in your backend services. This can help in identifying areas where crucial event tracking might be missing, aiding in improving system monitoring and error detection.

select
name,
id,
log_config_enable
from
gcp_compute_backend_service
where
not log_config_enable;
select
name,
id,
log_config_enable
from
gcp_compute_backend_service
where
log_config_enable = 0;

Schema for gcp_compute_backend_service

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
affinity_cookie_ttl_secbigintSpecifies the lifetime of the cookies in seconds. Only applicable if the loadBalancingScheme is EXTERNAL, INTERNAL_SELF_MANAGED, or INTERNAL_MANAGED, the protocol is HTTP or HTTPS, and the sessionAffinity is GENERATED_COOKIE, or HTTP_COOKIE.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
backendsjsonbAn list of backends that serve this BackendService.
cdn_policy_cache_key_policyjsonbSpecifies the CacheKeyPolicy for this CdnPolicy.
circuit_breakersjsonbSettings controlling the volume of connections to a backend service.
connection_draining_timeout_secbigintSpecifies the amount of time in seconds to allow existing connections to persist while on unhealthy backend VMs. Only applicable if the protocol is not UDP. The valid range is [0, 3600].
creation_timestamptimestamp with time zoneThe creation timestamp of the resource.
descriptiontextA user-specified, human-readable description of the backend service.
enable_cdnboolean!=, =Specifies whether the Cloud CDN is enabled for the backend service, or not.
failover_policyjsonbApplicable only to Failover for Internal TCP/UDP Load Balancing.
fingerprinttextAn unique system generated string, to reduce conflicts when multiple users change any property of the resource.
health_checksjsonbA list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service.
iapjsonbSpecifies the configurations for Identity-Aware Proxy on this resource.
idbigintThe unique identifier for the resource.
kindtextThe type of the resource.
load_balancing_schemetext!=, =Specifies the type of the load balancer.
locality_lb_policytextSpecifies the load balancing algorithm used within the scope of the locality.
locationtextThe GCP multi-region, region, or zone in which the resource is located.
location_typetextLocation type where the backend service resides.
log_config_enablebooleanSpecifies whether to enable logging for the load balancer traffic served by this backend service, or not.
log_config_sample_ratedouble precisionSpecifies the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0.
nametext=A friendly name that identifies the resource.
networktextThe URL of the network to which this backend service belongs.
portbigintSpecifies the TCP port to connect on the backend. The default value is 80.
port_nametext!=, =A named port on a backend instance group representing the port for communication to the backend VMs in that group.
projecttext=, !=, ~~, ~~*, !~~, !~~*The GCP Project in which the resource is located.
protocoltextSpecifies the protocol that the BackendService uses to communicate with backends.
regiontextThe URL of the region where the regional backend service resides. This field is not applicable to global backend services.
security_policytextThe resource URL for the security policy associated with this backend service.
security_settingsjsonbSpecifies the security policy that applies to this backend service.
self_linktextThe server-defined URL for the resource.
session_affinitytext!=, =Specifies the type of session affinity to use. The default is NONE. Session affinity is not applicable if the protocol is UDP.
signed_url_cache_max_age_secbigintSpecifies the maximum number of seconds the response to a signed URL request will be considered fresh.
signed_url_key_namesjsonbA list of names of the keys for signing request URLs.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
timeout_secbigintSpecifies the backend service timeout.
titletextTitle of the resource.

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)" -- gcp

You can pass the configuration to the command with the --config argument:

steampipe_export_gcp --config '<your_config>' gcp_compute_backend_service