To get the IP ranges for a specific service in a specific region, use this:
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.region=="us-west-1") | select(.service=="S3") | .ip_prefix'
To get the IP ranges for a specific service in a specific region, use this:
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.region=="us-west-1") | select(.service=="S3") | .ip_prefix'