It might be possible with standard text processing tools like awk, but ideally, you need a tool that understands JSON. Such as jq.
Code:
curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[] | select(.region == "us-west-2")' | more
This gets the
prefixes array from the data, then selects the array elements with the desired region.
jq is available from Ubuntu repos. Not sure about other distros.
Reference:
jq manual