简体   繁体   English

如何通过Java以编程方式显示特定的EC2实例成本(价格明细)

[英]How to display particular EC2 instance cost (price details) through java programmatically

I am creating AWS instances programmatically using AWS Java API. 我正在使用AWS Java API以编程方式创建AWS实例。 This entire process is developed as an web application. 整个过程作为Web应用程序开发。

Now the question is, after successfully purchasing an EC2 instance, how can I display the price details of that particular customer's instance cost? 现在的问题是,在成功购买EC2实例后,如何显示该特定客户的实例成本的价格详细信息?

This is not a capability exposed by the AWS EC2 API. 这不是AWS EC2 API公开的功能。

The pricing of instances is a back-office billing function, not a function of the real-time EC2 operational infrastructure, since -- among other reasons -- there are tiered volume discounts for large customers ... and the rating of reserved instances is not related to particular instances but is actually determined by how many instances you are running, correlated with the number of matching instances purchased. 实例的定价是后台计费功能,而不是实时EC2操作基础架构的功能,因为(除其他原因外)大客户可以享受批量折扣……而且预留实例的等级为与特定实例无关,但实际上取决于您正在运行的实例数量,并与购买的匹配实例数量相关。 (Whether a particular instance is billed as reserved or not can vary throughout the lifetime of the instance, if others are also running)... and spot instances are billed based on historical prices as they stood at the beginning of the spot instance's operational hour, each hour, not in fractional hours, even though the spot market price can fluctuate several times per hour. (如果某个特定实例是否被预留为预留,则在整个实例的生命周期内(如果其他实例也正在运行)可能会有所不同)...并且根据现货实例在其实例运行时间开始时的历史价格对其进行结算,即使现货市场价格每小时可能波动几次,也不会每小时计算。

The only known mechanism is the unofficial, unsupported, undocumented hack mentioned in the other question you referenced . 唯一已知的机制是您引用另一个问题中提到的非官方的,不受支持的,未记录的hack。 If you go that route, implementing it should be a pretty trivial exercise in Java or any other language... but the pricing you would be able to display would be an approximation. 如果走那条路,用Java或任何其他语言实现它应该是一件很简单的事……但是您能够显示的价格只是一个近似值。

Believe this has changed. 相信情况已经改变。 For anyone who lands here on a first search like I did. 对于像我一样在这里进行首次搜索的任何人。

https://aws.amazon.com/blogs/aws/new-aws-price-list-api/ https://aws.amazon.com/blogs/aws/new-aws-price-list-api/

AWS Blog AWS博客

New – AWS Price List API by Jeff Barr | 新增功能– Jeff Barr提供的AWS价格列表API | on 09 DEC 2015 | 上2015年12月9日| Permalink | 固定链接| Comments Many AWS customers and partners have been asking for a programmatic way to access prices for AWS services. 注释许多AWS客户和合作伙伴一直在寻求一种编程方式来获取AWS服务的价格。 This information can be used in several ways. 该信息可以几种方式使用。 Some potential customers are evaluating the feasibility and cost-effectiveness of moving their on-premises workloads to the cloud and want to “do the math.” Current customers and partners would like to make sure that their budgeting, forecasting, and analytics tools are able to analyze AWS prices without having to resort to scraping our web site. 一些潜在客户正在评估将本地工作负载迁移到云中的可行性和成本效益,并希望“算术”。当前的客户和合作伙伴希望确保他们的预算,预测和分析工具能够分析AWS价格而不必诉诸我们的网站。 Our Managed Services Partners create and supervise tens or thousands of linked AWS accounts (grouped together via Consolidated Billing) and need to make sure the bills presented to their customers reflect the cost of each resource. 我们的托管服务合作伙伴创建并监督成千上万个链接的AWS账户(通过合并账单分组在一起),并需要确保向客户显示的账单能够反映每种资源的成本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM