Skip to content

Instantly share code, notes, and snippets.

@cam8001
Created February 18, 2021 01:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cam8001/6daf3e1bc2c3a06bfbe18c18e5ca8c7e to your computer and use it in GitHub Desktop.
Save cam8001/6daf3e1bc2c3a06bfbe18c18e5ca8c7e to your computer and use it in GitHub Desktop.
AWS ip-ranges.json parsing with JQ examples
# Use jq to parse the published AWS IP ranges.
# Use the file from here: https://ip-ranges.amazonaws.com/ip-ranges.json
# Select all Cloudfront nodes homed to Sydney
jq .prefixes[] | select(.service == "CLOUDFRONT") | select(.network_border_group=="ap-southeast-2")
# Find s3 endpoints in Oregon
jq -r '.prefixes[] | select(.region=="us-east-2") | select(.service=="S3") | .ip_prefix' < ip-ranges.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment