Re:Show HN: Curl https://ec2.shop
by dxxvi on Tuesday June 30, 2020 @10:19AM
(#23690254)
Can I be sure that the prices from this endpoint are accurate (i.e. if Amzn changes the prices, this endpoint will reflect that change)?
Off-topic: if I request a spot instance, is there any way (API/cli) to know how much Amzn charges me every hour for that instance?
[ Parent
| on HN ]
I've built something like this in the past (I was running a beefy server for my friends, and wanted them to know how much it was costing us at an hourly rate, before they ran it for 3 weeks straight).
It's definitely possible and not very challenging, but the API Documentation for prices was pretty weak when I built it (a year or two ago, written in Go if it makes a difference). The google cloud prices API was similarly gross. It was kinda fun, but I wouldn't enjoy maintaining that code. In reality, it turns out that $/hour isn't a super straightforward metric (there are many dimensions that go into it), so it's not super straightforward to query.
I think the price is accurate. It's fetched directly from this Amazon endpoint. https://github.com/yeo/ec2.shop/blob/master/download.sh#L9
I'm going to add spot instance. Will just need to figure out what URL AWS is fetching