Skip to content

Instantly share code, notes, and snippets.

View foooomio's full-sized avatar
🎵
#PrayForKyoani

foooomio foooomio

🎵
#PrayForKyoani
View GitHub Profile
#!/usr/bin/env python3
# https://stackoverflow.com/questions/45441865/determine-aws-region-from-ip-address
from ipaddress import ip_network, ip_address
import requests
import sys
def find_aws_region(ip):
url = 'https://ip-ranges.amazonaws.com/ip-ranges.json'
ip_json = requests.get(url).json()