Skip to content

REST API for searching price of AWS EC2 instance

License

Notifications You must be signed in to change notification settings

9to6/aws-ec2-price

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-ec2-price

REST API for searching price of AWS EC2 instance

Installation

go get -u github.com/9to6/aws-ec2-price

This package requires some dependancies:

Usage in golang

import github.com/9to6/aws-ec2-price

pricing, err := price.NewPricing()
if err != nil {
	doSomething()
}

instances, err := pricing.GetInstances("us-east-1")
if err != nil {
	doSomething()
}

println(instances)

instance, err := pricing.GetInstance("us-east-1", "c4.large")
if err != nil {
	doSomething()
}

println(instance)

Run

aws-ec2-price --port=[PORT]

Default port is 8080.

Run with Docker

docker run -p 8080:8080 -d 9to5/aws-ec2-price

REST APIs

  • GET /ec2/regions/:region
  • GET /ec2/regions/:region/instance_types/:instance_type

References

About

REST API for searching price of AWS EC2 instance

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 95.4%
  • Dockerfile 2.8%
  • Makefile 1.8%