steampipe plugin install gcp

Table: gcp_compute_address - Query Google Cloud Compute Engine Addresses using SQL

An Address in Google Cloud Compute Engine is a static, external IP address that you reserve and assign to your instances. These reserved addresses can be used by cloud resources in the same region. They provide a reliable endpoint for your cloud services and are essential for load balancing and other network configurations.

Table Usage Guide

The gcp_compute_address table provides insights into the static, external IP addresses reserved within Google Cloud Compute Engine. As a network administrator, explore address-specific details through this table, including their status, type, and associated instances. Utilize it to oversee the allocation and usage of addresses, ensuring optimal network configurations and resource allocation.

Examples

Basic info

This query can be used to gain insights into the various IP addresses associated with your Google Cloud Platform (GCP) Compute Engine. It helps in understanding the type, creation time, IP version, status, associated subnetwork, and location of each address, which can be beneficial for managing and optimizing your network infrastructure.

select
address,
id,
address_type,
creation_timestamp,
ip_version,
status,
subnetwork,
location
from
gcp_compute_address;
select
address,
id,
address_type,
creation_timestamp,
ip_version,
status,
subnetwork,
location
from
gcp_compute_address;

List of address which are not in use

Discover the segments that consist of unused addresses in your Google Cloud Platform Compute Engine. This can help manage resources effectively by identifying and potentially freeing up unused addresses.

select
address,
address_type,
creation_timestamp,
status
from
gcp_compute_address
where
status != 'IN_USE';
select
address,
address_type,
creation_timestamp,
status
from
gcp_compute_address
where
status != 'IN_USE';

Address count by each network_tier

Analyze the distribution of addresses across different network tiers in your Google Cloud Platform to better understand your resource allocation. This could be useful in optimizing network performance and managing costs effectively.

select
network_tier,
count(*)
from
gcp_compute_address
group by
network_tier
order by
network_tier;
select
network_tier,
count(*)
from
gcp_compute_address
group by
network_tier
order by
network_tier;

Get details of users that are using an address

Gain insights into the details of users who are utilizing a specific address. This can be particularly useful for understanding user distribution and managing resources efficiently.

select
name,
address,
id,
jsonb_pretty(users)
from
gcp_compute_address
where
name = 'test2';
select
name,
address,
id,
users
from
gcp_compute_address
where
name = 'test2';

Schema for gcp_compute_address

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
addressinetThe static IP address represented by this resource.
address_typetext!=, =The type of address to reserve, either INTERNAL or EXTERNAL.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
creation_timestamptimestamp with time zoneThe creation timestamp of the resource.
descriptiontextA user-specified, human-readable description of the address.
idbigintThe unique identifier for the resource.
ip_versiontextThe IP version that will be used by this address.
kindtextThe type of the resource.
locationtextThe GCP multi-region, region, or zone in which the resource is located.
nametext=A friendly name that identifies the resource.
networktextThe URL of the network in which to reserve the address.
network_tiertext!=, =Specifies the networking tier used for configuring this address.
prefix_lengthbigintSpecifies the prefix length if the resource represents an IP range.
projecttext=, !=, ~~, ~~*, !~~, !~~*The GCP Project in which the resource is located.
purposetext!=, =Specifies the purpose of the resource.
self_linktextThe server-defined URL for the resource.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statustext!=, =The status of the address.
subnetworktextThe URL of the subnetwork in which to reserve the address.
titletextTitle of the resource.
usersjsonbA list of URLs of the resources that are using this address.

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_address