turbot/gcp_insights

Query: compute_instances_for_compute_network

Usage

powerpipe query gcp_insights.query.compute_instances_for_compute_network

SQL

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