turbot/alicloud_insights

Query: ecs_autoscaling_groups_for_ecs_instance

Usage

powerpipe query alicloud_insights.query.ecs_autoscaling_groups_for_ecs_instance

SQL

select
asg.scaling_group_id as autoscaling_group_id
from
alicloud_ecs_autoscaling_group as asg,
jsonb_array_elements(asg.scaling_instances) as group_instance,
alicloud_ecs_instance as i
where
i.arn = $1
and i.account_id = split_part($1, ':', 5)
and i.region = split_part($1, ':', 4)
and group_instance ->> 'InstanceId' = i.instance_id;