Skip to content

Retrieve spot instance price histories

Michael A. Cianfrocco edited this page Apr 10, 2015 · 5 revisions

In order to retrieve quickly EC2 instance spot instance history over a given time period, we used a custom python program to return spot instance prices for all regions, all availability zones:

$ ./get_spot_histories_all_regions_all_zones.py 
Usage: get_spot_histories_all_regions_all_zones.py -i [instance type] --days=[days]
Options:
  -h, --help  show this help message and exit
  -i STRING   Amazon instance type (e.g. r3.8xlarge, t2.micro, etc.)
  --days=INT  Timeframe over which to retrieve spot instance price history.
              Maximum is 90 days.
  -d          debug 

This program assumes the following environmental variables have been set:

export AWS_ACCESS_KEY=[access key]
export AWS_SECRET_KEY=[secret key]
export AWS_USER_ID=[user id]

Which are environmental variables required for Amazon command line tools.

Clone this wiki locally