Last active
December 12, 2020 01:21
-
-
Save garnaat/73804a6b0bd506ee6075 to your computer and use it in GitHub Desktop.
Skew script to find all unattached EBS volumes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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