Created
September 9, 2015 05:44
-
-
Save nfelsen/dc1e89435948ead2ecbf to your computer and use it in GitHub Desktop.
unused aws vpc security group assuming all securitry groups are used by either RDS or EC2
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
comm -23 <(aws --region us-east-1 ec2 describe-security-groups --query 'SecurityGroups[*].GroupId' --output text | tr '\t' '\n'| sort) <(((aws --region us-east-1 ec2 describe-instances --query 'Reservations[*].Instances[*].SecurityGroups[*].GroupId' --output text | tr '\t' '\n') ; (aws --region us-east-1 rds describe-db-instances --query 'DBInstances[*].VpcSecurityGroups[*].VpcSecurityGroupId' --output text | tr '\t' '\n')) | sort | uniq) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment