• Stars
    star
    172
  • Rank 219,909 (Top 5 %)
  • Language
    Python
  • License
    Other
  • Created over 12 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Quick and dirty Python API and CLI to get EC2 instance pricing for On-Demand and Reserved Instances

ec2instancespricing.py

Written by Eran Sandler (@erans)
http://eran.sandler.co.il
http://forecastcloudy.net (@forecastcloudy)

ec2instancespricing.py is a quick & dirty library and a command line interface (CLI) to get a list of all Amazon Web Services EC2 instances pricing including On-Demand, Spot and Reserved instances (in all utilization levels).

The data is based on a set of JSON files used in the EC2 page (http://aws.amazon.com/ec2). You can get a list of all available JSON files in this blog post: http://forecastcloudy.net/2012/04/02/amazon-web-services-aws-ec2-pricing-data/

The original JSON files as published by Amazon don't contain the same values used throughout the EC2 API. This library/cli maps the values in the JSON files to their corresponding values used throughout the EC2 API. Such values include region names, instance type, etc.

Data can be filtered by region, instance_type, instance_type_pattern and os_type.

Importing this file will allow you to use two functions:

  • get_ec2_ondemand_instances_prices - to get the pricing of On-Demand instances
  • get_ec2_reserved_instances_prices - to get the pricing of reserved instances (in all utilization levels)
  • get_ec2_spot_instances_prices - to get the pricing of spot instances

Running this file will activate its CLI interface in which you can get output to your console in a CSV, JSON, line and table formats (default is table).

To run the command line interface, you need to install:

  • argparse - if you are running Python < 2.7
  • prettytable - to get a nice table output to your console
  • demjson - for easier JSON parsing

All of these libraries can be installed using the 'pip install' command.

There are the following types of listings:

  • ondemand - listing of ondemand instance prices
  • reserved - listing of reserved instance prices
  • spot - listing of spot instance prices
  • spotordemand - listing of spot and ondemand instance prices
  • all - listing of ondemand, reserved and spot instance prices

More Repositories

1

pysnowflake

Python implementation of Twitter's Snowflake Unique ID generation service
Python
206
star
2

redissnowflake

Twitter's Snowflake based ID generation as a redis module
C
72
star
3

fabric-slack-tools

Tools to integrate Fabric with Slack
Python
45
star
4

gosnowflake

Twitter's Snowflake server implemented in Go
Go
32
star
5

pysnowflakeclient

Python Client for Twitter's Snowflake Unique ID Generator Service
Python
16
star
6

fabric-gce-tools

Tools to integrate Fabric with Google Compute Engine (GCE)
Python
9
star
7

flask-secure-cookie

Adds Tornado's secure cookie support to Flask
Python
8
star
8

thumbla

Image serving and manipulation
Go
7
star
9

beanstalkdcloudwatch

Script to update AWS CloudWatch with custom metric from a Beanstalkd work queue (http://kr.github.com/beanstalkd/)
Python
7
star
10

gonionoo

Go wrapper for Onionoo - Tor network status protocol (https://onionoo.torproject.org/)
Go
6
star
11

dicepass

Digital version of EFF's dice (http://eff.org/dice)
HTML
6
star
12

membase_cloudformation_template_generator

Membase CloudFormation template generator
Python
6
star
13

twitter-csharp-library

Twitter C# REST API Library (Wrapper)
C#
6
star
14

sqscloudwatchqueuecount

Script to update AWS CloudWatch with a custom metric which contains the count of an AWS SQS queue
Python
6
star
15

ec2ssh

A simple script to use EC2 Name tags to connect directly to machines
Python
5
star
16

torcontactinfoparser

Tor ContactInfo proposal (https://github.com/nusenu/ContactInfo-Information-Sharing-Specification) parser
Python
5
star
17

nsq-to-bigquery

Stream NSQ messages to Google's BigQuery using the streaming API
Go
5
star
18

fabric-aws-tools

Tools to integrate Amazon Web Services (AWS) with Fabric
Python
4
star
19

torcontactinfogenerator

Tor ContactInfo Generator
HTML
3
star
20

thriftify

Thrift Compiler as a Service
Python
3
star
21

upupaway

Up, up and Away (upupaway) a cloud upload micro service
Go
3
star
22

redisunique

RedisUnique is a Redis module to generate unique IDs
C
2
star
23

microstripe

A microservice for processing Stripe charges and subscriptions
Go
1
star
24

gooz

Go implementation of Oz Web Authorization Protocol (https://github.com/hueniverse/oz)
1
star
25

gobriteverify

Go client for Brite Verify API
Go
1
star
26

pipeline

Go based Pipeline wrappers that saves a lot of boilerplate code
Go
1
star