Gem to grab lowest priced instance type in a region.
Properly setup AWS Shared Credentials
Install the gem like so:
gem install spothop
require 'spothop'
SpotHop.GetPricing("m3.medium","us-east-1")
=> {:availability_zone=>"us-east-1d", :spot_price=>"0.010000"}
---
<%= require 'spothop' %>
driver_config:
region: <%= ENV['AWS_REGION'] || 'us-east-1' %>
price: <%= require 'spothop'; SpotHop.GetPricing(ENV['EC2_INSTANCE_TYPE'],ENV['AWS_REGION'])[:spot_price] %>
availability_zone: <%= require 'spothop'; SpotHop.GetPricing(ENV['EC2_INSTANCE_TYPE'],ENV['AWS_REGION'])[:availability_zone] %>