steampipe plugin install gcp

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_scheme
from
gcp_compute_forwarding_rule;
select
name,
id,
self_link,
backend_service,
ip_address,
load_balancing_scheme
from
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_access
from
gcp_compute_forwarding_rule
where
not allow_global_access;
select
name,
id,
allow_global_access
from
gcp_compute_forwarding_rule
where
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_scheme
from
gcp_compute_forwarding_rule
where
load_balancing_scheme = 'EXTERNAL';
select
name,
id,
load_balancing_scheme
from
gcp_compute_forwarding_rule
where
load_balancing_scheme = 'EXTERNAL';

Schema for gcp_compute_forwarding_rule

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
all_portsboolean!=, =Specify this field to allow packets addressed to any ports will be forwarded to the backends configured with this forwarding rule.
allow_global_accessboolean!=, =Specifies whether clients can access ILB from all regions, or not.
backend_servicetextSpecifies the BackendService resource to receive the matched traffic.
creation_timestamptimestamp with time zoneThe creation timestamp of the resource.
descriptiontextA user-specified, human-readable description of the resource.
fingerprinttexta hash of the contents stored in this object and used for optimistic locking.
idbigintThe unique identifier for the resource.
ip_addressinetSpecifies the IP address that this forwarding rule serves.
ip_protocoltext!=, =The IP protocol to which this rule applies.
ip_versiontextThe IP Version that will be used by this forwarding rule.
is_mirroring_collectorboolean!=, =Indicates whether or not this load balancer can be used as a collector for packet mirroring.
kindtextThe type of the resource.
labelsjsonbA list of labels attached to this resource.
load_balancing_schemetext!=, =Specifies the forwarding rule type.
locationtextThe GCP multi-region, region, or zone in which the resource is located.
metadata_filtersjsonbOpaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set of xDS compliant clients.
nametext=A friendly name that identifies the resource.
networktextSpecifies the network that the load balanced IP should belong to for this Forwarding Rule.
network_tiertext!=, =Specifies tthe networking tier used for configuring this load balancer.
port_rangetextSpecifies the port range. Packets addressed to ports in the specified range will be forwarded to target or backendService.
portsjsonbA list of ports can be configured.
projecttext=, !=, ~~, ~~*, !~~, !~~*The GCP Project in which the resource is located.
regiontextThe URL of the region where the regional forwarding rule resides.
self_linktextThe server-defined URL for the resource.
service_labeltextA prefix to the service name for this Forwarding Rule. If specified, the prefix is the first label of the fully qualified service name.
service_nametextThe internal fully qualified service name for this Forwarding Rule.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
subnetworktextSpecifies the subnetwork that the load balanced IP should belong to for this Forwarding Rule.
tagsjsonbA map of tags for the resource.
targettextThe URL of the target resource to receive the matched traffic.
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_forwarding_rule