turbot/gcp_insights

Query: compute_instances_for_iam_service_account

Usage

powerpipe query gcp_insights.query.compute_instances_for_iam_service_account

SQL

select
i.id::text || '/' || i.project as instance_id
from
gcp_service_account as s,
gcp_compute_instance as i,
jsonb_array_elements(service_accounts) as sa
where
sa ->> 'email' = s.email
and s.name = split_part($1, '/', 1);