turbot/gcp_insights

Query: compute_addresses_for_compute_subnetwork

Usage

powerpipe query gcp_insights.query.compute_addresses_for_compute_subnetwork

SQL

select
a.id::text as address_id
from
gcp_compute_address a,
gcp_compute_subnetwork s
where
s.id = (split_part($1, '/', 1))::bigint
and s.project = split_part($1, '/', 2)
and s.self_link = a.subnetwork
union
select
a.id::text as address_id
from
gcp_compute_global_address a,
gcp_compute_subnetwork s
where
s.id = (split_part($1, '/', 1))::bigint
and s.project = split_part($1, '/', 2)
and s.self_link = a.subnetwork;