turbot/alicloud_insights

Query: ram_roles_for_ecs_instance

Usage

powerpipe query alicloud_insights.query.ram_roles_for_ecs_instance

SQL

select
distinct r.arn as role_arn
from
alicloud_ecs_instance as i,
alicloud_ram_role as r,
jsonb_array_elements(i.ram_role) as role
where
role ->> 'RamRoleName' is not null
and r.name = role ->> 'RamRoleName'
and i.arn = $1
and i.account_id = split_part($1, ':', 5)
and i.region = split_part($1, ':', 4);