Created
February 18, 2021 01:26
-
-
Save cam8001/6daf3e1bc2c3a06bfbe18c18e5ca8c7e to your computer and use it in GitHub Desktop.
AWS ip-ranges.json parsing with JQ examples
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
# 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