Extending EC2 API - ec2-describe-ipaddress-ranges

Do you remember how we used to programmatically consume services on the web before proliferation of APIs? That’s right - scraping! And do you know what prevents us from using this technique now, when some piece of data you need for your application, is not available via API? That’s right - absolutely nothing!

I recently came across something that was not available via EC2 API - lists of IP address ranges for each EC2 region. AWS team maintain such lists in their forums - currently at http://developer.amazonwebservices.com/connect/ann.jspa?annID=735 (I say “currently” because annID has already changed at least once). I asked for API, but in the meantime since I needed this now, I wrote a simple python script to scrape and parse the data - http://gist.github.com/559397 or embedded below. Enjoy! By the way, who would have thought that one would need to resort to scraping AWS, the very pioneers of infrastructure APIs, to get this simple bit of information?

Categories: cloud-computing | python |