ec2instances.info
ec2instances.info copied to clipboard
Can you add pricing from China?
China's aws users are also very large, I believe it will be very valuable.
希望关注这个问题,谢谢。
The data should be easy to add, but it's not currently available at https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/$REGION>/index.json
Please raise this with AWS and once we have the data available there for the Chinese regions as well we can easily add support for it
Should be very similar to https://github.com/powdahound/ec2instances.info/pull/395 once AWS makes that data available. I can prepare a pull request in advance
@PatMyron The data is available now 🎉 https://aws.amazon.com/about-aws/whats-new/2018/12/announcing-aws-price-list-api-availability-in-china/
@PatMyron, @ChampionWolf please try to update #403, test and report back the results.
@cristim Good call, still seeing "unavailable" in the price cells when I test that pull request.
Anyone have any ideas why?
From poking around, I found one China offer index file that existed but it seems like the corresponding file for a specific China region is not available:
https://pricing.cn-north-1.amazonaws.com.cn/offers/v1.0/aws/AmazonEC2/current/index.json
https://pricing.cn-north-1.amazonaws.com.cn/offers/v1.0/aws/AmazonEC2/current/cn-north-1/index.json
@PatMyron I think the Chinese pricing API is only available if you have AWS China account.
Perhaps someone with access to an account from China could process and publish this data as JSON somewhere so then we can merge this data at build time with the data from the rest of the world and display all the data on ec2instances.info.
Or maybe someone can create something like ec2instances.cn that just has the Chinese data.
Any suggestions or help to sort this out would be more than welcome.
FWIW it's available from https://amazonaws.cn/en/ec2/pricing/ec2-linux-pricing/, but yes it is quite awkward to parse and intake.
@PatMyron So according to https://pricing.cn-north-1.amazonaws.com.cn/offers/v1.0/cn/AmazonEC2/current/region_index.json, the following index files should be used:
"regions" : {
"cn-north-1" : {
"regionCode" : "cn-north-1",
"currentVersionUrl" : "/offers/v1.0/cn/AmazonEC2/20190716030142/cn-north-1/index.json"
},
"cn-northwest-1" : {
"regionCode" : "cn-northwest-1",
"currentVersionUrl" : "/offers/v1.0/cn/AmazonEC2/20190716030142/cn-northwest-1/index.json"
}
}
@difanz please consider creating a patch that integrates these into the codebase.
Great find! I worry about outdated data if 20190716030142
is hardcoded
Replacing with current
reveals some files:
https://pricing.cn-north-1.amazonaws.com.cn/offers/v1.0/cn/AmazonEC2/current/cn-north-1/index.json
https://pricing.cn-north-1.amazonaws.com.cn/offers/v1.0/cn/AmazonEC2/current/cn-northwest-1/index.json
https://pricing.us-east-1.amazonaws.com/offers/v1.0/cn/AmazonEC2/current/cn-north-1/index.json
https://pricing.us-east-1.amazonaws.com/offers/v1.0/cn/AmazonEC2/current/cn-northwest-1/index.json
https://pricing.us-east-1.amazonaws.com/offers/v1.0/cn/AmazonRDS/current/index.json
@PatMyron I guess we won't hardcode that but fetch the current index from https://pricing.us-east-1.amazonaws.com/offers/v1.0/cn/AmazonEC2/current/region_index.json and generate the versioned URLs from its content. Or perhaps the pricing API may just do this under the hood (hopefully) without any work from our side.
I don't think Pricing API can do this. rds.py parses through a very similar file so it might be a good idea to just extract the code from there. Also #367 might provide more context from the last time we discussed pricing data.