Skip to content

Instantly share code, notes, and snippets.

View marcelotpcosta's full-sized avatar
🏠
Working from home

Marcelo Costa marcelotpcosta

🏠
Working from home
  • Lisbon
  • 17:20 (UTC +01:00)
View GitHub Profile
@thibautsacreste
thibautsacreste / aws.sg
Last active March 11, 2023 04:58
Bash: AWS security group uses
#!/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" | \