AWS IP Ranges is a Python library for working with AWS IP address ranges natively. It provides tools to download, parse, and query the AWS IP address ranges JSON data (from https://ip-ranges.amazonaws.com/ip-ranges.json). Current version is 0.3.3, released periodically.
pip install awsiprangesVerified import paths — ran on the pinned version, not inferred.
Download the AWS IP ranges JSON and filter by region and service.
Store the result in a variable and iterate over it directly.
Replace `prefixes.sync()` with `prefixes.download()`.
Ensure your Python version is in the supported range (3.7-3.11 tested).
Use `from awsipranges import AWSIPPrefixes`.
Ensure the machine has internet access and can reach https://ip-ranges.amazonaws.com/. Alternatively, use a proxy with the `proxies` parameter.
Do not chain filters. Instead, save the first result and apply a second filter manually: `result = prefixes.filter(...); second = [p for p in result if ...]`.