turbot/gcp_insights

Query: compute_instances_for_compute_instance_group

Usage

powerpipe query gcp_insights.query.compute_instances_for_compute_instance_group

SQL

select
i.id::text || '/' || i.project as instance_id
from
gcp_compute_instance as i,
gcp_compute_instance_group as g,
jsonb_array_elements(instances) as ins
where
g.id = (split_part($1, '/', 1))::bigint
and g.project = split_part($1, '/', 2)
and (ins ->> 'instance') = i.self_link;