turbot/gcp_insights

Query: iam_roles_for_pubsub_topic

Usage

powerpipe query gcp_insights.query.iam_roles_for_pubsub_topic

SQL

select
i.name as role_id
from
gcp_iam_role i,
gcp_pubsub_topic t,
jsonb_array_elements(t.iam_policy -> 'bindings') as roles
where
roles ->> 'role' = i.name
and i.project = t.project
and t.self_link = $1;