Have you ever wondered how to find the current market spot rate for an instance? When people first hear that spot instances can save you up 60%-90%, they tend to react in disbelief. This is natural and understandable, it just sounds too good to be true. Fortunately, there are many ways to confirm that the 60%-90% spot price savings is real. This article tries to lists the many ways in one place.

Spot Pricing Page

Let’s start off with the public pages. The first one is the Amazon EC2 Spot Instances Pricing. Here we can select the region and we get a simple list of instances and spot prices. The listing shows hourly prices and does not include the percentage savings.

Spot Instance Advisor Page

From the same Amazon EC2 Spot Instances Pricing page there’s a link to the Spot Instance Advisor page. You can also google for “Spot Instance Advisor” to find it. This page is also public. The advisor page provides a simple calculated list. You input how much CPUs and Memory you would like, and it instantly updates with a list with instance types that meet your requirements. It’s nice that it shows how much you’ll save in percentage vs. on-demand. It also shows an interesting “Frequency of Interruption” percentage. Most instances are interrupted less than 5% of the time.

EC2 Console Pricing History

The next way to check on spot instance pricing requires logging into your AWS account. There is a Pricing History Chart link that brings a chart which shows prices over time. This is a neat way and one of my favorite ways to see the spot price of an instance.

Here’s summary of how to get to there:

  1. Go to the EC2 console
  2. Click on Spot Requests on the left-hand side menu
  3. Click on Pricing History in the upper menu.

Here’s where the Pricing History button is:

After you have selected instances and click on the Pricing History button, you’ll be able to choose an instance type. It is interesting to change the date range to 3 months to see how much spot prices have changed.

Also if you go a little deeper and click on Request Spot Instances, choose some Instance Types, click Select, and then click the Pricing History button, you can select multiple instances and compare them all in one chart. Similar steps to get to these charts also provided in the AWS EC2 Guide Docs.

EC2 Console Spot Advisor

The EC2 Console Spot Advisor is similar to the public Spot Instance Advisor page except with more options. To get to it:

  1. Go to the EC2 console
  2. Click on Spot Requests on the left-hand side menu
  3. Click on Spot Advisor in the upper menu.

The Spot Advisor button is in the same menu area as the Pricing History button:

From the EC2 Console Spot Advisor Page you can input how many CPUs and how much RAM you’ll like and even launch a Spot Fleet from there:

EC2 Console Launch Instance Wizard Spot Option

We can also see spot pricing when we launch an instance with the EC2 Launch Wizard. This is available in Step 3 Configure Instance of the wizard with the Request Spot Instances option.

AWS CLI

Next, I’ll show you how to find current spot price with the aws cli describe-spot-price-history command. I like this method because it is quick and handy when you already have the aws cli installed. The command lists the spot prices for all AZs in a region for a specific instance type. Here’s the command:

$ aws ec2 describe-spot-price-history --start-time=$(date +%s) --product-descriptions="Linux/UNIX" --query 'SpotPriceHistory[*].{az:AvailabilityZone, price:SpotPrice}' --instance-types c4.large
[
    {
        "az": "us-west-2c",
        "price": "0.028700"
    },
    {
        "az": "us-west-2b",
        "price": "0.028700"
    },
    {
        "az": "us-west-2a",
        "price": "0.028700"
    }
]
$

You can also get the current spot price with the aws-sdk of your choice. I was pleasantly surprised to see how easy it was to get the spot price with the cli and aws-sdk.

Here’s a one-liner that will do a little math and tell you what the monthly price for the spot instance is.

$ I=t2.small ; printf "\$%.2f/mo\n" $(echo "$(aws ec2 describe-spot-price-history --instance-types $I --start-time=$(date +%s) --product-descriptions="Linux/UNIX" | jq -r '.SpotPriceHistory[0].SpotPrice') * 24 * 30" | bc)
$4.97

And here’s a loop that does a similar thing with a list of instances:

for I in t2.small t2.medium m5.large; do
  printf "$I: \$%.2f/mo\n" $(echo "$(aws ec2 describe-spot-price-history --instance-types $I --start-time=$(date +%s) --product-descriptions="Linux/UNIX" | jq -r '.SpotPriceHistory[0].SpotPrice') * 24 * 30" | bc)
done

You should see something like this:

t2.small: $4.97/mo
t2.medium: $10.01/mo
m5.large: $29.30/mo

Normal EC2 Pricing

Here’s also how to check standard on-demand EC2 pricing. For that, I find it convenient and handy to use this site: ec2instances.info. The site scrapes several pages to produce a list that is quite user-friendly. It’s handy to change the cost to a monthly basis, select the instances you’re interested in and click Compare Selected.

Summary

Okay, we went over several ways on how to find current EC2 instance spot market prices. Let me know if you there are other useful ways. Hope you found this helpful. 🎉