turbot/gcp_insights

Query: compute_instances_for_compute_subnetwork

Usage

powerpipe query gcp_insights.query.compute_instances_for_compute_subnetwork

SQL

select
i.id::text || '/' || i.project as instance_id
from
gcp_compute_instance i,
gcp_compute_subnetwork s,
jsonb_array_elements(network_interfaces) as ni
where
ni ->> 'subnetwork' = s.self_link
and s.id = (split_part($1, '/', 1))::bigint
and s.project = split_part($1, '/', 2);