Table: gcp_compute_subnetworks

This table shows data for GCP Compute Subnetworks.

https://cloud.google.com/compute/docs/reference/rest/v1/subnetworks#Subnetwork (opens in a new tab)

The primary key for this table is self_link.

Columns

NameType
_cq_iduuid
_cq_parent_iduuid
project_idutf8
creation_timestamputf8
descriptionutf8
enable_flow_logsbool
external_ipv6_prefixutf8
fingerprintutf8
gateway_addressutf8
idint64
internal_ipv6_prefixutf8
ip_cidr_rangeutf8
ipv6_access_typeutf8
ipv6_cidr_rangeutf8
kindutf8
log_configjson
nameutf8
networkutf8
private_ip_google_accessbool
private_ipv6_google_accessutf8
purposeutf8
regionutf8
roleutf8
secondary_ip_rangesjson
self_link (PK)utf8
stack_typeutf8
stateutf8

Example Queries

These SQL queries are sampled from CloudQuery policies and are compatible with PostgreSQL.

Ensure that VPC Flow Logs is enabled for every subnet in a VPC Network (Automated)

SELECT
  DISTINCT
  gcn.name AS resource_id,
  'Ensure that VPC Flow Logs is enabled for every subnet in a VPC Network (Automated)'
    AS title,
  gcn.project_id AS project_id,
  CASE WHEN gcs.enable_flow_logs = false THEN 'fail' ELSE 'pass' END AS status
FROM
  gcp_compute_networks AS gcn
  JOIN gcp_compute_subnetworks AS gcs ON gcn.self_link = gcs.network;