Show AWS IP Ranges on OSX in Terminal

in #aws7 years ago

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:

Sort:  

Your Post Has Been Featured on @Resteemable!
Feature any Steemit post using resteemit.com!
How It Works:
1. Take Any Steemit URL
2. Erase https://
3. Type re
Get Featured Instantly & Featured Posts are voted every 2.4hrs
Join the Curation Team Here | Vote Resteemable for Witness

Coin Marketplace

STEEM 0.12
TRX 0.34
JST 0.033
BTC 121932.72
ETH 4429.25
BNB 1310.91
SBD 0.78