turbot/azure_thrifty
GitHub
Loading controls...

Control: Unused disks should be removed

Description

Unattached disks are charged by Azure, they should be removed unless there is a business need to retain them.

Usage

Run the control in your terminal:

steampipe check azure_thrifty.control.compute_disk_unattached

Snapshot and share results via Steampipe Cloud:

steampipe login
steampipe check --share azure_thrifty.control.compute_disk_unattached

Plugins & Tables

SQL

select
disk.id as resource,
case
when disk.disk_state = 'Unattached' then 'alarm'
else 'ok'
end as status,
case
when disk.disk_state = 'Unattached' then disk.title || ' has no attachments.'
else disk.title || ' has attachments.'
end as reason,
disk.resource_group,
display_name as subscription
from
azure_compute_disk as disk,
azure_subscription as sub
where
sub.subscription_id = disk.subscription_id;

Tags