You’ll be able to question the ip-ranges
Amazon AWS URL, and parse the consequences via jq
as follows:
Generic S3 IP Levels
Question:
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | make a choice(.carrier=="S3")'
Reaction:
{
"ip_prefix": "3.5.140.0/22",
"area": "ap-northeast-2",
"carrier": "S3",
"network_border_group": "ap-northeast-2"
}
{
"ip_prefix": "52.219.170.0/23",
"area": "eu-central-1",
"carrier": "S3",
<truncated>
Area Explicit S3 IP Levels
Question:
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | make a choice(.area=="eu-west-1") | make a choice(.carrier=="S3") | .ip_prefix'
Reaction:
18.34.32.0/20
3.5.72.0/23
52.218.0.0/17
3.5.64.0/21
52.92.0.0/17
18.34.240.0/22
3.251.110.208/28
3.251.110.224/28