aws-ec2-price

module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2020 License: Apache-2.0

README

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

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL