为什么实例类型的价格与原始AWS列表不同?

时间:2015-12-31 07:41:31

标签: python amazon-web-services amazon-ec2 boto boto3

我在python中使用boto ec2查询AWS定价。 首先,我发现所有使用get_all_reserved_instances_offerings提供特定实例类型的实例, 然后,对于所有实例返回上面,我正在按小时频率检查金额和固定价格'。我通过以下代码执行此操作:

for ins in each_ins.recurring_charges:
    if ins.frequency == 'Hourly':
        print float(ins.amount)
    print float(each_ins.fixed_price)

each_ins.fixed_price正确打印

"d2.2xlarge": 3844.0,

"m3.2xlarge": 1961.0,

它显示正确的价格,如带红色标记的图片所示:

enter image description here

但ins.amount打印:

"d2.2xlarge": 0.438,

"m3.2xlarge": 0.248, 

我认为它应该是0.8768,如上图所示,带有绿色标记。

1 个答案:

答案 0 :(得分:0)

绿色框中的值是一年中每小时实例的总体有效成本(即计算一年中每小时的费用加上一年中的初始前期费用差异。)

ins.amount值是每月每小时收费,忽略了最初的前期费用。从每月费用大致计算一个月后,每小时费用约为0.444,几乎与您所看到的值相对应。

AWS says the following with respect to the continuing monthly charges:

*This is the average monthly payment over the course of the RI term. For each month, the actual monthly payment will equal the actual number of hours in that month multiplied by the hourly usage rate. The hourly usage rate is equivalent to the total average monthly payments over the term of the RI divided by the total number of hours (based on a 365 day year) over the term of the RI.

相关问题