turbot/gcp_insights

Query: compute_subnetworks_for_compute_network

Usage

powerpipe query gcp_insights.query.compute_subnetworks_for_compute_network

SQL

with compute_subnetwork as (
select
id,
network,
project
from
gcp_compute_subnetwork
), compute_network as (
select
id,
self_link
from
gcp_compute_network
where
id = (split_part($1, '/', 1))::bigint
and project = split_part($1, '/', 2)
)
select
s.id::text || '/' || s.project as subnetwork_id
from
compute_subnetwork s,
compute_network n
where
s.network = n.self_link;