How can I find the IP address ranges used by Amazon S3?

Last updated: 2020-01-14

How can I find the IP address ranges used by Amazon Simple Storage Service (Amazon S3)?

Resolution

First, download the JSON file that contains all AWS IP address ranges. Then, search the file for the string "service": "S3".

On Linux or macOS machines, you can use a tool like jq tool to parse the JSON response. For example, the following command parses the JSON file for all IPv4 addresses used by Amazon S3:

curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.service=="S3") | .ip_prefix'

52.95.154.0/23

52.219.64.0/22

52.92.72.0/22

52.92.64.0/22

52.95.156.0/24

....

As another example, the following command parses the JSON response for all IPv4 addresses used by Amazon S3 in a specific AWS Region (us-east-1):

curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.region=="us-east-1") | select(.service=="S3") | .ip_prefix'

54.231.0.0/17

52.92.16.0/20

52.216.0.0/15

On Windows operating systems, you can use AWS Tools for PowerShell. The following Get-AWSPublicIpAddressRange command filters for all IPv4 and IPv6 addresses used by Amazon S3:

Get-AWSPublicIpAddressRange -ServiceKey S3 | select IpPrefix
IpPrefix
--------
52.47.73.72/29
13.55.255.216/29
52.15.247.208/29
...
...
2a05:d07c:2000::/40
2a05:d000:8000::/40
2406:dafe:2000::/40
...

For more examples, see Filtering the JSON File.


Did this article help you?

Anything we could improve?


Need more help?