steampipe plugin install gcp

Table: gcp_compute_target_pool - Query Google Cloud Compute Target Pools using SQL

Google Cloud Compute Target Pools are a group of instances located in the same region that are used for forwarding rules. They are used to define where incoming traffic should be directed. The instances within a target pool can be added or removed as per the requirements.

Table Usage Guide

The gcp_compute_target_pool table provides insights into the target pools within Google Cloud Compute Engine. As a network administrator, explore target pool-specific details through this table, including the state, region, and session affinity of each target pool. Utilize it to uncover information about target pools, such as their backup pools, failover ratios, and the health checks they are associated with.

Examples

Basic info

Explore which Google Cloud Platform (GCP) compute target pools are available in your environment. This can help in managing load balancing by identifying the specific locations of these resources.

select
name,
id,
location
from
gcp_compute_target_pool;
select
name,
id,
location
from
gcp_compute_target_pool;

List of target pools and attached instances that receives incoming traffic

Explore which target pools and their attached instances are set to receive incoming traffic. This can be used to determine the configuration and traffic management of your network, ensuring optimal performance and security.

select
name,
id,
split_part(i, '/', 11) as instance_name
from
gcp_compute_target_pool,
jsonb_array_elements_text(instances) as i;
Error: SQLite does not support split_part function.

List of Health checks attached to each target pool

Explore the health check mechanisms associated with each target pool to effectively monitor and manage your resources in Google Cloud Platform. This can help you maintain optimal performance and quickly address any issues that arise.

select
name,
id,
split_part(h, '/', 10) as health_check
from
gcp_compute_target_pool,
jsonb_array_elements_text(health_checks) as h;
Error: SQLite does not support split
or string_to_array functions.

Schema for gcp_compute_target_pool

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
creation_timestamptimestamp with time zoneTimestamp when the target pool was created.
descriptiontextAn optional description of this resource.
health_checksjsonbThe URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. An empty list means all member instances will be considered healthy at all times.
idbigintThe unique identifier for the resource.
instancesjsonbA list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool.
kindtextType of the resource. Always compute#targetPool for target pools.
locationtextThe GCP multi-region, region, or zone in which the resource is located.
nametext=Name of the resource.
projecttextThe GCP Project in which the resource is located.
regiontextURL of the region where the target pool resides.
region_nametextThe region name where the target pool resides.
self_linktextServer-defined URL for the resource.
session_affinitytext!=, =Session affinity option, must be one of the following values: (CLIENT_IP | CLIENT_IP_PORT_PROTO | CLIENT_IP_PROTO | GENERATED_COOKIE | HEADER_FIELD | HTTP_COOKIE | NONE )
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_target_pool