Created
February 21, 2016 09:47
-
-
Save lueo/ac32598a41f2f641b133 to your computer and use it in GitHub Desktop.
Get aws ip ranges
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import requests | |
import json | |
r = requests.get('https://ip-ranges.amazonaws.com/ip-ranges.json') | |
j = r.json() | |
print j['createDate'] | |
for c in j['prefixes']: | |
if c['region'] == "ap-northeast-1": | |
print '{0:<20} {1:<20}'.format(c['ip_prefix'],c['service']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment