Have you ever wanted a way to access the Amazon Web Services EC2 pricing data from code?
It seems Amazon uses predefined JSON files in the EC2 page to display the pricing per region per instance type and type of utilization.
You can easily access these JSON files, load it and use it in your own apps (at least until Amazon changes these URLs).
The naming in these JSON files is sometimes different than the naming used in the API so for example, a small instance (m1.small) is “size” : “sm” and its type is “stdODI” or “stdResI” for reserved instances.
Below are the links to the relevant files:
On Demand Instances
- On Demand Instances – http://aws.amazon.com/ec2/pricing/pricing-on-demand-instances.json
- Light Utilization Linux – http://aws.amazon.com/ec2/pricing/ri-light-linux.json
- Light Utilization Windows – http://aws.amazon.com/ec2/pricing/ri-light-mswin.json
- Medium Utilization Linux – http://aws.amazon.com/ec2/pricing/ri-medium-linux.json
- Medium Utilization Windows – http://aws.amazon.com/ec2/pricing/ri-medium-mswin.json
- Heavy Utilization Linux – http://aws.amazon.com/ec2/pricing/ri-heavy-linux.json
- Heavy Utilization Windows – http://aws.amazon.com/ec2/pricing/ri-heavy-mswin.json
Data Transfer Pricing
- Data Transfer Pricing – http://aws.amazon.com/ec2/pricing/pricing-data-transfer.json
Cloud Watch Pricing
- Cloud Watch Pricing – http://aws.amazon.com/ec2/pricing/pricing-cloudwatch.json
Elastic IPs Pricing
- Elastic IPs Pricing – http://aws.amazon.com/ec2/pricing/pricing-elastic-ips.json
Elastic Load Balancer (ELB) Pricing
- Elastic Load Balancer (ELB) Pricing – http://aws.amazon.com/ec2/pricing/pricing-elb.json
Crunch these files and enjoy it while its there 🙂