Skip to content
  • Products
    • Portfolio overview >

      Flexsave™

      Automatically manage cloud compute for optimized costs and agility

      Cloud Analytics

      Make sense of spend and chargeback to align with your business

      google cloud msp

      BigQuery Lens

      Optimize BigQuery costs with actionable recommendations and usage insights

      Spot Scaling

      Maximize AWS Spot savings and minimize disruptions for optimized scaling

      Anomaly Detection

      Autonomously identify cost spikes early, with zero configuration

      Platform overview >

      Organize your billing data for better business decisions

  • Services
    • Services overview >

      How we work

      Learn how we’re redefining support with our customer reliability engineering

      Stats

      View our live support and customer satisfaction statistics in real-time

      Cloud solutions

      Proven solutions to cloud complexity

      FinOps

      Learn how DoiT enables critical FinOps capabilities

      Areas of expertise

      Cloud Architecture

      Ensure your cloud architecture is future-ready and built for success

      Cloud Cost Optimization

      Identify opportunities to optimize costs and target spend for added value

      Cloud Migration

      Realize greater efficiency and innovation with successful cloud migration

      Cloud Security

      Center security in your cloud strategy to ensure ongoing efficacy and growth

      Data and Analytics

      Harness the potential of big data and analytics to gain a competitive edge

      Data Management

      Build your data practice with expert guidance tailored to your business goals

      DevOps Jump Start

      Accelerate your AWS workloads & release pipelines while also increasing automation, monitoring & reliability

      Infrastructure

      Maximize the full suite capabilities from your cloud infrastructure

      Kubernetes

      Manage the complexity of Kubernetes to enable innovation and scalability

      Location-Based Services

      Transform geolocational data into real-world, real-time intelligence

      Machine Learning

      Level-up key data with ML capabilities that accelerate innovation

      Multicloud

      Create meaningful business value with a robust multicloud strategy

      Training

      Build skills and capability across teams with certified, expert-led training

  • Partners
    • Alliances

      Proud to be an award‒winning multicloud partner to top‒tier cloud providers

      doit-together

      DoiT Together

      Enabling cloud growth and unlocking revenue through expert partnership

      ISV Go-Global

      Accelerate new customer growth and Marketplace integration on AWS and GCP

  • Resources
    • Resources hub >

      Blog

      Read the latest insights, tips and perspectives from our team of cloud experts

      Case Studies

      See how we’ve helped thousands of public cloud customers achieve their goals

      Cloud Masters Podcast

      Listen to our experts and customers share tangible tips for navigating the cloud.

      Ebooks and Guides

      Discover foundational expertise and future-ready recommendations for the cloud

      Events and Webinars

      Tech talks and interactive expert sessions delivered both virtually and in person

      GCPInstances.info

      Google Cloud Compute Engine instance comparison

      Help center

      Read documentation, product updates, and more

      Newsroom

      See what's new from DoiT in our latest news and announcements

      Trust Center

      How we focus on security, compliance, and privacy

      Videos

      Watch product demos, interviews and more from our cloud experts

  • About
    • About DoiT >

      Careers

      Browse our open positions and learn more about what it takes to be a Do’er

      Leadership

      Meet the team leading DoiT and our customers on a journey of hypergrowth

      Newsroom

      See what's new from DoiT in our latest news and announcements

  • Pricing
  • Contact us
  • Sign In
  • Products
    • Flexsave ™
    • Cloud Analytics
    • Spot Scaling
    • BigQuery Lens
    • Anomaly Detection
    • DoiT Platform
  • Services
    • How We Work
    • Stats
    • Cloud Solutions
    • FinOps
    • Areas of expertise
      • Cloud Architecture
      • Cloud Cost Optimization
      • Cloud Migration Consulting Services
      • Cloud Security
      • Data and Analytics
      • Data Management
      • DevOps with AWS & DoiT
      • Infrastructure
      • Kubernetes
      • Location Based Services
      • Machine Learning
      • Multicloud
      • Training
  • Partners
    • ISV Go-Global
    • Award-winning public cloud partner
    • DoiT Together
  • Resources
    • Blog
    • Case Studies
    • Cloud Masters Podcast
    • Ebooks and Guides
    • Events and Webinars
    • GCPInstances.info
    • Help center
    • Newsroom
    • Trust Center
    • Videos
  • Pricing
  • About
    • Careers
    • Leadership
    • Newsroom
  • Contact us
  • Sign In
Contact us
Sign in

Blog

Spotinfo  —  a new CLI for AWS Spot

  • Alexei Ledenev Alexei Ledenev
  • Date: May 13, 2021

1 ujy37yrdtevs13lxufagyq

Explore AWS spot Instances from the command line

TL;DR

The spotinfo is a command-line tool you can use for exploring AWS Spot instances across multiple AWS regions.

Introduction

Using Amazon EC2 Spot instances is an excellent way to reduce EC2 on-demand instance cost, up to 90%. Whenever you have a workload that can survive VM interruption or be suspended and resumed later on without impacting business use cases, choosing the Spot pricing model is a no-brainer choice.

The lower your interruption rate, the longer your Spot instances are likely to run.

Amazon provides an excellent web interface AWS Spot Instance Advisor to explore available Spot instances and determine spot instance pools with the least chance of interruption. You can also check the savings you get over on-demand rates. You can also check the savings you get over on-demand rates. And then, you are supposed to use these metrics for selecting appropriate Spot instances.

While the AWS Spot Instance Advisor is a valuable tool, it is not easy to use its data for scripting and automation, and some use cases require too many clicks.

Spotinfo tool

That’s why I created the spotinfo tool. It's an easy-to-use command-line tool (open source under Apache 2.0 License) that allows you to explore AWS Spot instances in a terminal and use the spot data it provides for scripting and automation.

Under the hood, the spotinfo is using two public data sources available from AWS:

  1. AWS Spot Instance Advisor data feed
  2. AWS Spot Pricing data feed

Features

The spotinfo allows you to access the same information you can see in the AWS Spot Instance Advisor, but from a command line and can be used for scripting and automation use cases. In addition, the tool provides some useful features that are not available for the AWS Spot Instance Advisor web interface.

Advanced Filtering

The first feature is advanced filtering. You can filter spot instances by:

  • vCPU — minimum number of CPU cores
  • Memory GiB — minimum memory size
  • Operating system — Linux or Windows
  • Region — one or more AWS regions (or all AWS regions)
  • Savings (compared to on-demand)
  • Frequency of interruption
  • Hourly rate (in USD/hour)

When filtering by instance type, regular expressions are supported. And this can help you create advanced queries.

Example: filter with Regex

List (as text) all available EC2 Spot instances powered by Graviton2 processor, with a minimum of eight CPU cores, in the us-west-2 (Oregon) region, sorting results by spot price.

Spot Price Visibility

With AWS Spot Instance Advisor, you can see a discount compared to the on-demand EC2 instance rate. But to find out, what is the actual price, you are going to pay, you must visit a different AWS Spot pricing web page and search it again for the specific instance type.

The spotinfo saves your time and can display the spot price alongside other information. You can also filter and sort by spot price if you like.

Flexible Output Formats

Working with data in a command line and accessing data from scripts and automation requires flexibility of output format. The spotinfo can return results in multiple formats: human-friendly formats, like table and plain text, and automation-friendly: json, csv, or just a saving number. Choose whatever format you need for any concrete use case.

Compare Spots across multiple Regions

One annoying thing about the AWS Spot Instance Advisor is the inability to compare EC2 spot instances across multiple AWS regions. Only a single region view is available, or you need to open multiple browser tabs and constantly switch between them to compare spot instances across multiple AWS regions.

The spotinfo can help you to compare spot instances across multiple AWS regions. All you need to do is pass a --region command-line flag, and you can use this flag more than once.

Another option is to pass a special all value (with --region=all flag) to see spot instances across all available AWS regions.

Example: explore t4g.small Spot instance

Explore the t4g.small spot instance type availability and rate across all AWS regions, where this instance type is available.

Network Resilience

While the spotinfo uses public AWS data feeds, it also embeds the same data within the tool. So, if the data feed is not available, for any reason (no connectivity, service not available or other), the spotinfo still will be able to return the same result.

Summary

I hope the spotinfo could be a helpful tool for exploring AWS EC2 spot instances. And I'm looking forward to your comments and any questions you might have.

I invite you to contribute (issues, features, pull requests) to the alexei-led/spotinfo GitHub project.

p.s.: if you like the spotinfo tool, consider giving the GitHub project a ⭐️


Thanks for reading! To stay connected, follow us on the DoiT Engineering Blog, DoiT Linkedin Channel, and DoiT Twitter Channel. To explore career opportunities, visit https://careers.doit.com.

Subscribe to updates, news and more.

Subscribe

Subscribe to updates, news and more.

Related blogs

Using predefined IAM roles for enhanced Google Maps Platform governance

Examining using predefined Google Cloud IAM roles dedicated to Google Maps usage to enhance the governance of these activities.

Keep reading 
ramp plans behind the design DoiT

Behind the design: Ramp plans

I’m Jack Green, a UX designer at DoiT, and I’m here to talk about some design changes and decisions

Keep reading 
Overcoming-Overlapping-Subnet-Challenges-with-Inter-VPC-NAT-in-GCP

Overcoming Overlapping Subnet Challenges with Inter-VPC NAT in GCP

In the vast landscape of cloud computing, network management is a critical component of ensuring your applications and services run smoothly.

Keep reading 
View all blogs
Let’s do it

From cost optimization to cloud migration, machine learning and CloudOps, we’re here to make the public cloud easy — without the costs.

Ready to get started?

Get in touch

Company

  • About us
  • Blog
  • Careers
  • MS-HT statement
  • Newsroom
  • Privacy policy
  • Terms

Offering

  • Compliance
  • Products
  • Services
  • Solutions
  • Resources

Support

  • Sign in
  • Help center
  • Open ticket
  • Contact us

Never miss an update.

Subscribe to our newsletter

Subscribe to updates, news and more.