AWS EC2 product prices
david karapetyan May 13
Some parts of AWS are pretty advanced, other parts not so much. If you go looking for product prices then you will find a few web pages. If you then start looking for an API then you will again find something but it's more like a data dump than an API.
The EC2 product pricing endpoint returns a 300MB JSON file with no way to query it other than opening it in a text editor and doing a search. You might think I'm joking but I'm not because that is literally what their documentation suggests.
This seemed like a yak that needed shaving so I did. Here's the razor that I used to shave that yak.
To download the JSON file you will need to run
var prices = require('./ec2-prices.js'); prices.ec2ProductInformation();
That will download and save the prices in
Once you have the JSON file you can then run the following to generate the SQLite database
var prices = require('./ec2-prices.js'); prices.populateDatabase();
That will create a file called
prices.db and you can then query it with SQL syntax. It doesn't have all the information because I made it for my use cases but the code is commented and should be easily extendable.
Happy yak shaving!