turbot/alicloud_insights

Query: ram_policies_for_ram_role

Usage

powerpipe query alicloud_insights.query.ram_policies_for_ram_role

SQL

select
p.policy_name as policy_name
from
alicloud_ram_role as r,
alicloud_ram_policy as p,
jsonb_array_elements(r.attached_policy) as policy
where
r.arn = $1
and r.account_id = p.account_id
and policy ->> 'PolicyName' = p.policy_name;