Get Spot Price History by using aws-lib

We are going to get the pricing history for t1.micro instances by using aws-lib (Extensible Node.js library for the Amazon Web Services API):

var aws = require("aws-lib");
var ec2 = aws.createEC2Client(accessKeyId, secretAccessKey);
var iType = 't1.micro';
ec2.call('DescribeSpotPriceHistory', {'InstanceType.1':iType}, function(result) {
    console.log(result.spotPriceHistorySet.item); 
  } 
);
Advertisements

One thought on “Get Spot Price History by using aws-lib

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s