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
#!/usr/bin/env bash | |
# shows uses of an AWS security group: | |
# * lists all network interfaces it is attached to. | |
# * lists all other security groups referencing it in inbound rules. | |
# usage: aws.sg my-security-group-name | |
# requires aws-cli and jq. | |
group_name=$1 | |
group_id=`aws ec2 describe-security-groups --filters "Name=group-name,Values=$group_name" | \ |