Control: Disks attached to stopped instances should be reviewed
Description
Instances that are stopped may no longer need any attached disks.
Usage
Run the control in your terminal:
powerpipe control run alicloud_thrifty.control.ecs_disk_attached_stopped_instance
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run alicloud_thrifty.control.ecs_disk_attached_stopped_instance --share
Steampipe Tables
SQL
select d.arn as resource, case when d.instance_id is null then 'skip' when i.status = 'Running' then 'ok' else 'alarm' end as status, case when d.instance_id is null then d.title || ' not attached to instance.' when i.status = 'Running' then d.title || ' attached to running instance' || ' ' || d.instance_id || '.' else d.title || ' attached to stopped instance' || ' ' || d.instance_id || '.' end as reason , d.account_id, d.regionfrom alicloud_ecs_disk as d left join alicloud_ecs_instance as i on d.instance_id = i.instance_id;