Skip to content

Instantly share code, notes, and snippets.

@davewalk
Created April 28, 2015 20:55
Show Gist options
  • Save davewalk/69e0bd8fd1b4e0c2db81 to your computer and use it in GitHub Desktop.
Save davewalk/69e0bd8fd1b4e0c2db81 to your computer and use it in GitHub Desktop.
Save all of the AWS EC2 IP ranges for a given region using jq (more info: http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html)
cat ip-ranges.json | jq '.prefixes' | jq '.[]' | jq '.service = "EC2"' | jq '.region = "us-east-1"' | jq '.ip_prefix' > ec2-us-east-1-ranges.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment