Skip to content

Instantly share code, notes, and snippets.

@corvax19
Created November 7, 2018 13:37
Show Gist options
  • Save corvax19/eb25f166a35e241e0b22f22164fce7db to your computer and use it in GitHub Desktop.
Save corvax19/eb25f166a35e241e0b22f22164fce7db to your computer and use it in GitHub Desktop.
List AWS EC2 instance types
#!/usr/bin/env python
import requests
URL='https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/us-east-1/index.csv'
lines = requests.get(URL).text.split('\n')[6:]
for type in sorted(set([s[18] for s in [ l.split('","') for l in lines ] if len(s)>18 and s[18] and '.' in s[18]])):
print(type)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment