Last active
August 14, 2023 06:09
-
-
Save yayohei/81b2753076aaf889c3565bf5c4c4d409 to your computer and use it in GitHub Desktop.
get all security group
This file contains hidden or 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
aws ec2 describe-network-interfaces | \ | |
jq -r '.NetworkInterfaces[] | ((if .Attachment.InstanceId? then "ec2" else .Description end) | split(":")[0:3] | join(":") | split(" ")[0:3] | join(" ")) as $desc | .Groups[] | [$desc, .GroupName, .GroupId] | @tsv' | \ | |
sort | \ | |
uniq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment