Skip to content

Instantly share code, notes, and snippets.

@cam8001

cam8001/jq-aws.bash

Created Feb 18, 2021
Embed
What would you like to do?
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