Table: gcp_compute_forwarding_rule - Query GCP Compute Forwarding Rules using SQL
A GCP Compute Forwarding Rule is a resource within Google Cloud Platform's Compute Engine service. It specifies which network traffic is directed to which specific load balancer components. Forwarding rules are associated with specific IP addresses.
Table Usage Guide
The gcp_compute_forwarding_rule
table provides insights into forwarding rules within Google Cloud Platform's Compute Engine service. As a network engineer or system administrator, you can explore specific details about each forwarding rule, including their associated IP addresses, target proxies, and port ranges. Use this table to understand your network traffic direction and management within your GCP environment.
Examples
Basic info
Explore the configuration of your Google Cloud Platform's compute forwarding rules to gain insights into the load balancing scheme and backend service. This can be useful in determining areas where network traffic is being directed and ensuring optimal distribution of workload.Explore which IP addresses are associated with your load balancing scheme in Google Cloud Platform. This can help you understand how your network traffic is being directed and managed.
select name, id, self_link, backend_service, ip_address, load_balancing_schemefrom gcp_compute_forwarding_rule;
select name, id, self_link, backend_service, ip_address, load_balancing_schemefrom gcp_compute_forwarding_rule;
List of forwarding rules which are not globally accessible
Identify the forwarding rules that are not accessible globally. This query is useful for ensuring network security by pinpointing potential vulnerabilities.Explore which forwarding rules in your Google Cloud Platform (GCP) compute environment are not globally accessible. This can help ensure your network configuration aligns with your security and accessibility requirements.
select name, id, allow_global_accessfrom gcp_compute_forwarding_rulewhere not allow_global_access;
select name, id, allow_global_accessfrom gcp_compute_forwarding_rulewhere allow_global_access = 0;
List of EXTERNAL forwarding rules
Explore which forwarding rules are set to 'EXTERNAL' in the Google Cloud Platform's Compute Engine. This can help assess network traffic routing configurations for security or optimization purposes.Discover the segments that utilize external load balancing schemes within your Google Cloud Platform's forwarding rules. This can help manage traffic flow and optimize resource allocation within your network infrastructure.
select name, id, load_balancing_schemefrom gcp_compute_forwarding_rulewhere load_balancing_scheme = 'EXTERNAL';
select name, id, load_balancing_schemefrom gcp_compute_forwarding_rulewhere load_balancing_scheme = 'EXTERNAL';
Query examples
Schema for gcp_compute_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. |
region | text | The URL of the region where the regional forwarding rule resides. | |
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_forwarding_rule