Table: gcp_compute_global_forwarding_rule - Query GCP Compute Global Forwarding Rules using SQL
A Global Forwarding Rule in Google Cloud Platform (GCP) is a component of the Cloud Load Balancing service. It is responsible for forwarding traffic from specified IP addresses to a target instance, target proxy, or target pool. These rules can be used to distribute incoming network traffic across multiple compute instances to ensure that no single instance is overwhelmed.
Table Usage Guide
The gcp_compute_global_forwarding_rule
table provides insights into the Global Forwarding Rules within Google Cloud Platform's Compute service. As a network engineer, you can use this table to explore details about each rule, including the IP addresses it handles, its target instances, and its associated load balancing configurations. This can be especially beneficial in optimizing your network traffic distribution and ensuring efficient load balancing across your compute instances.
Examples
Basic info
Gain insights into the details of global forwarding rules, such as their names, IDs, IP addresses, protocols, port ranges, and targets within the Google Cloud Platform. This can be useful in understanding the networking configuration and traffic routing in your cloud environment.
select name, id, ip_address, ip_protocol, port_range, targetfrom gcp_compute_global_forwarding_rule;
select name, id, ip_address, ip_protocol, port_range, targetfrom gcp_compute_global_forwarding_rule;
List global forwarding rules which are globally accessible
Determine the areas in which global forwarding rules are set to be globally accessible, allowing for a broadened network reach and enhanced connectivity. This can be particularly useful in understanding the scope of your network access and identifying potential security considerations.
select name, id, ip_address, allow_global_accessfrom gcp_compute_global_forwarding_rulewhere allow_global_access;
select name, id, ip_address, allow_global_accessfrom gcp_compute_global_forwarding_rulewhere allow_global_access = '1';
List global forwarding rules where mirroring collector is enabled (i.e load balancer can be used as a collector for packet mirroring)
Discover the segments that have enabled the packet mirroring feature, allowing the load balancer to collect data. This is useful in analyzing network traffic for security monitoring or troubleshooting.
select name, id, is_mirroring_collectorfrom gcp_compute_global_forwarding_rulewhere is_mirroring_collector;
select name, id, is_mirroring_collectorfrom gcp_compute_global_forwarding_rulewhere is_mirroring_collector = '1';
Query examples
Schema for gcp_compute_global_forwarding_rule
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. | |
all_ports | boolean | !=, = | Specify this field to allow packets addressed to any ports will be forwarded to the backends configured with this forwarding rule. |
allow_global_access | boolean | !=, = | Specifies whether clients can access ILB from all regions, or not. |
backend_service | text | Specifies the BackendService resource to receive the matched traffic. | |
creation_timestamp | timestamp with time zone | The creation timestamp of the resource. | |
description | text | A user-specified, human-readable description of the resource. | |
fingerprint | text | a hash of the contents stored in this object and used for optimistic locking. | |
id | bigint | The unique identifier for the resource. | |
ip_address | inet | Specifies the IP address that this forwarding rule serves. | |
ip_protocol | text | !=, = | The IP protocol to which this rule applies. |
ip_version | text | !=, = | The IP Version that will be used by this forwarding rule. |
is_mirroring_collector | boolean | !=, = | Indicates whether or not this load balancer can be used as a collector for packet mirroring. |
kind | text | The type of the resource. | |
labels | jsonb | A list of labels attached to this resource. | |
load_balancing_scheme | text | !=, = | Specifies the forwarding rule type. |
location | text | The GCP multi-region, region, or zone in which the resource is located. | |
metadata_filters | jsonb | Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set of xDS compliant clients. | |
name | text | = | A friendly name that identifies the resource. |
network | text | Specifies the network that the load balanced IP should belong to for this Forwarding Rule. | |
network_tier | text | !=, = | Specifies tthe networking tier used for configuring this load balancer. |
port_range | text | Specifies the port range. Packets addressed to ports in the specified range will be forwarded to target or backendService. | |
ports | jsonb | A list of ports can be configured. | |
project | text | =, !=, ~~, ~~*, !~~, !~~* | The GCP Project in which the resource is located. |
self_link | text | The server-defined URL for the resource. | |
service_label | text | A prefix to the service name for this Forwarding Rule. If specified, the prefix is the first label of the fully qualified service name. | |
service_name | text | The internal fully qualified service name for this Forwarding Rule. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
subnetwork | text | Specifies the subnetwork that the load balanced IP should belong to for this Forwarding Rule. | |
tags | jsonb | A map of tags for the resource. | |
target | text | The URL of the target resource to receive the matched traffic. | |
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_global_forwarding_rule