This content was muted by moderators for not following community guidelines.

Show AWS IP Ranges on OSX in Terminal

Words
89
Reading
1 min
8y
Listen to this post
~1 min

This is just a quick oneliner which I got from a friend. You can use it if you would like to view the IP ranges for AWS on the command line. I tested this on OSX, so I'm not sure if it works on Linux, OSX has mostly BSD utilities like BSD grep etc.

Here is the one liner:

$ curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | "\(.ip_prefix) | \(.region) | \(.service)"'  | grep EC2 | grep eu-west-1 | awk '{ print $1 }' | aggregate

You will have to have jq and aggregate installed in order to run this:

$ brew install aggregate jq

Btw if you don't know what jq is yet, then you better get familiar with it:

Show AWS IP Ranges on OSX in Terminal | Ecency