Skip to content

Instantly share code, notes, and snippets.

@garnaat
Last active December 12, 2020 01:21
Show Gist options
  • Save garnaat/73804a6b0bd506ee6075 to your computer and use it in GitHub Desktop.
Save garnaat/73804a6b0bd506ee6075 to your computer and use it in GitHub Desktop.
Skew script to find all unattached EBS volumes
import skew
total_size = 0
total_volumes = 0
for volume in skew.scan('arn:aws:ec2:*:*:volume/*'):
if not volume.data['Attachments']:
total_volumes += 1
total_size += volume.data['Size']
print('%s: %dGB' % (volume.arn, volume.data['Size']))
print('Total unattached volumes: %d' % total_volumes)
print('Total size (GB): %d' % total_size)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment