Giter VIP home page Giter VIP logo

ec2.shop's Introduction

Get ec2 price right from your terminal

curl 'https://ec2.shop'

If you prefer json, use:

curl -H 'accept: json' 'https://ec2.shop'

If you want to search for a certain instance:

curl 'https://ec2.shop?filter=i3'
curl 'https://ec2.shop?filter=ssd'

Why

AWS pricing page is very slow, sometime just timing out say "Fail to load price". I know similar service like https://ec2instances.info/ but it's also slow and didn't have curl-able interface.

All I want is a way to compare/check price right from terminal. The URL need to be short and easy to remember, thus ec2.shop.

How accurate is the price

It's very accurate for on-demand instance, as accurate as whatever on this page: https://aws.amazon.com/ec2/pricing/on-demand/

For spot instances, The price is refresh every 2.5 minutes from this page: https://aws.amazon.com/ec2/spot/pricing/

The spot instances price may change in 5 minutes, so we migh have a slightly outdate but given our fetch schedule(twice per 5 minutes) I think we're pretty good there.

Will you maitenance this?

I need it myself and it's very cheap to keep it running mngiven a majority of request are cached at Cloudflare.

Otherwise, you can run it yourself. I had Dockerfile, k8s, makefile to help you run it.

API Document

We support either text base or json base response. text base is useful in text processing with awk. text base is default mode. To use JSON, simply pass a accept: json header.

curl -H 'accept: json' 'https://ec2.shop'

To filter out response result:

Example, to find all *.large instance type:

curl -H 'accept: json' 'https://ec2.shop?filter=.large'

To find instance support ssd:

curl -H 'accept: json' 'https://ec2.shop?filter=ssd'

The filter parameter is an or query type, so you can do this:

curl 'https://ec2.shop?filter=t2.medium,t3.medium'

The text response looks like this:

Instance Type    Memory             vCPUs  Storage               Network             Price       Monthly     Spot Price
c5d.9xlarge      72 GiB          36 vCPUs  1 x 900 NVMe SSD      10 Gigabit          1.7280      1261.440    0.7175
m5dn.24xlarge    384 GiB         96 vCPUs  4 x 900 NVMe SSD      100 Gigabit         6.5280      4765.440    1.6323
m6g.large        8 GiB            2 vCPUs  EBS only              Up to 10 Gigabit    0.0770      56.210      0.0357
m5.xlarge        16 GiB           4 vCPUs  EBS only              Up to 10 Gigabit    0.1920      140.160     0.0806
a1.metal         32 GiB          16 vCPUs  EBS only              Up to 10 Gigabit    0.4080      297.840     0.1343

All price are for Linux instance. For JSON, the response contains these:

    {
      "InstanceType": "r3.xlarge",
      "Memory": "30.5 GiB",
      "VCPUS": 4,
      "Storage": "1 x 80 SSD",
      "Network": "Moderate",
      "Cost": 0.333,
      "MonthlyPrice": 243.09,
      "SpotPrice": "0.0650"
    }

Unfortunately the SpotPrice is a string :-( because sometime it contains this text: "SpotPrice": "NA" when that instance type isn't available for purchase on Spot Instance(as in, they are only available for on-demand).

Icon

Use price icon by https://www.iconfinder.com/WTicon

ec2.shop's People

Contributors

v9n avatar sheldonkwok avatar pluies avatar kkuchta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.