I have a scenario to find all the ipv4 addresses amazon web services is having (assuming I have ip-ranges.json stored locally) then parse through the json to get total number of ip-adresses available for ipv4 and how many ipv4 adresses are there for a particular region. Is there any way to do that.
code:
import requests
IP = 'http://ip-ranges.amazonaws.com/ip-ranges.json'
ranges = requests.get(IP).json()
services = {}
for prefix in ranges['prefixes']:
print prefix