steampipe plugin install gcp

Table: gcp_compute_node_template - Query Google Cloud Compute Node Templates using SQL

A Google Cloud Compute Node Template is a resource within Google Cloud's Compute Engine that defines the properties of a node group to be created. Node Templates specify the server configuration of instances in a node group. This includes the type of CPU, amount of memory, and disk size and type.

Table Usage Guide

The gcp_compute_node_template table provides insights into node templates within Google Cloud's Compute Engine. As a Cloud Engineer, explore template-specific details through this table, including CPU and memory configurations, disk size and type, and associated metadata. Utilize it to uncover information about node templates, such as those with specific configurations, the properties of each node template, and the verification of node template properties.

Examples

List of n2-node-80-640 type node templates

Determine the areas in which specific node templates of type 'n2-node-80-640' are used in your Google Cloud Platform. This can be helpful to understand the distribution and usage of this particular node type across different locations.

select
name,
id,
location,
node_type
from
gcp_compute_node_template
where
node_type = 'n2-node-80-640';
select
name,
id,
location,
node_type
from
gcp_compute_node_template
where
node_type = 'n2-node-80-640';

List of node templates where cpu overcommit is enabled

Determine the areas in which CPU overcommit is enabled within node templates, to manage resource allocation effectively and optimize cloud infrastructure performance.

select
name,
id,
node_type
from
gcp_compute_node_template
where
cpu_overcommit_type = 'ENABLED';
select
name,
id,
node_type
from
gcp_compute_node_template
where
cpu_overcommit_type = 'ENABLED';

Count of node templates per location

Determine the distribution of node templates across different locations in your Google Cloud Platform. This can help you understand the geographical spread of your compute resources for better resource management and planning.

select
location,
count(*)
from
gcp_compute_node_template
group by
location;
select
location,
count(*)
from
gcp_compute_node_template
group by
location;

Find unused node templates

Explore which node templates in your Google Cloud Platform are not currently being used. This can help in identifying unused resources, potentially leading to cost savings and better resource management.

select
t.name,
t.id
from
gcp_compute_node_template as t
left join gcp_compute_node_group as g on g.node_template = t.self_link
where
g is null;
select
t.name,
t.id
from
gcp_compute_node_template as t
left join gcp_compute_node_group as g on g.node_template = t.self_link
where
g.node_template is null;

Schema for gcp_compute_node_template

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
cpu_overcommit_typetext!=, =Specifies the CPU overcommit.
creation_timestamptimestamp with time zoneThe creation timestamp of the resource.
descriptiontextA user-specified, human-readable description of the node template.
iam_policyjsonbAn Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`.
idbigintThe unique identifier for the resource.
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.
node_affinity_labelsjsonbA list of labels to use for node affinity, which will be used in instance scheduling.
node_typetext!=, =Specifies the type of the nodes to use for node groups, that are created from this template.
node_type_flexibility_cpustextThe URL of the network in which to reserve the address.
node_type_flexibility_local_ssdtextSpecifies the networking tier used for configuring this address.
node_type_flexibility_memorytextSpecifies the prefix length if the resource represents an IP range.
projecttextThe GCP Project in which the resource is located.
regiontextThe name of the region where the node template resides.
self_linktextThe server-defined URL for the resource.
server_binding_typetextSpecifies the binding properties for the physical server.
statustext!=, =Specifies the status of the node template.
status_messagetextA human-readable explanation of the resource status.
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_node_template