turbot/alicloud_insights

Query: ecs_disk_attached_instances

Usage

powerpipe query alicloud_insights.query.ecs_disk_attached_instances

SQL

select
i.instance_id as "Instance ID",
i.name as "Name",
i.arn as "Instance ARN",
i.status as "Instance State",
attachment ->> 'AttachedTime' as "Attachment Time"
from
alicloud_ecs_disk as v,
jsonb_array_elements(attachments) as attachment,
alicloud_ecs_instance as i
where
i.instance_id = attachment ->> 'InstanceId'
and v.arn = $1
and v.account_id = split_part($1, ':', 5)
and v.region = split_part($1, ':', 4)
order by
i.instance_id;

Dashboards

The query is used in the dashboards: