turbot/alicloud_insights

Query: ecs_instances_for_ram_role

Usage

powerpipe query alicloud_insights.query.ecs_instances_for_ram_role

SQL

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