Created
February 16, 2021 18:57
-
-
Save joswr1ght/55ef4c90ea7f964b043b75ac55c224bc to your computer and use it in GitHub Desktop.
Get AWS IP Addresses for a Specified Area
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
wget -qO- https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[] | if .region == "us-east-1" then .ip_prefix else empty end' -r | head -3 |
#!/bin/bash
REGION=$1
...
Nicely done. 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#!/bin/bash
REGION=$1
if [[ "${REGION}" == "" ]]; then
echo "Usage: $0 "
exit 1
fi
wget -qO- https://ip-ranges.amazonaws.com/ip-ranges.json | jq --arg region ${REGION} '.prefixes[] | if .region == $region then .ip_prefix else empty end' -r