Skip to content

Instantly share code, notes, and snippets.

@feylya
feylya / security-group-cleanup.py
Last active December 10, 2015 21:58 — forked from miketheman/security-group-cleanup.py
Checks all security groups used by all instances in an AWS account and compares them to the list of all security groups, deleting the unused ones.
#!/usr/bin/env python
import sys
import boto
import pprint
del_flag = ''
if len(sys.argv) > 1:
del_flag = sys.argv[1]