Skip to content

Instantly share code, notes, and snippets.

View garnaat's full-sized avatar

Mitch Garnaat garnaat

View GitHub Profile
@garnaat
garnaat / lost_volumes.py
Last active December 12, 2020 01:21
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']))
@garnaat
garnaat / untagged_instances.py
Created October 17, 2014 15:52
Find all untagged EC2 instances
import skew
for instance in skew.scan('arn:aws:ec2:*:*:instance/*'):
if not instance.tags:
print('%s is untagged' % instance.arn)