REST API for searching price of AWS EC2 instance
go get -u github.com/odg0318/aws-ec2-price
This package requires some dependancies:
import github.com/odg0318/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)
aws-ec2-price --port=[PORT]
Default port is 8080.
docker run -p 8080:8080 -d guri/aws-ec2-price
- GET /ec2/regions/:region
- GET /ec2/regions/:region/instance_types/:instance_type