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, locationfrom gcp_compute_target_pool;
select name, id, locationfrom 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_namefrom 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_checkfrom gcp_compute_target_pool, jsonb_array_elements_text(health_checks) as h;
Error: SQLite does not support splitor string_to_array functions.
Schema for gcp_compute_target_pool
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
creation_timestamp | timestamp with time zone | Timestamp when the target pool was created. | |
description | text | An optional description of this resource. | |
health_checks | jsonb | The 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. | |
id | bigint | The unique identifier for the resource. | |
instances | jsonb | A 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. | |
kind | text | Type of the resource. Always compute#targetPool for target pools. | |
location | text | The GCP multi-region, region, or zone in which the resource is located. | |
name | text | = | Name of the resource. |
project | text | =, !=, ~~, ~~*, !~~, !~~* | The GCP Project in which the resource is located. |
region | text | URL of the region where the target pool resides. | |
region_name | text | The region name where the target pool resides. | |
self_link | text | Server-defined URL for the resource. | |
session_affinity | text | !=, = | 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 ) |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
title | text | Title 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