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

Why price of an instance type showing different from original AWS list?

我正在 python 中使用 boto ec2 查询 AWS 定价。 首先,我使用 get_all_reserved_instances_offerings 查找特定实例类型的所有提供实例, 然后对于上面的所有实例 return,我正在检查 'hourly frequency' 中的数量和固定价格。我通过以下代码执行此操作:

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,

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

但是 ins.amount 打印:

"d2.2xlarge": 0.438,

"m3.2xlarge": 0.248, 

我觉得应该是0.8768如上图绿色标记的

绿色框中的值是实例在一年中每小时的总有效成本(即占一年中的每小时费用加上一年中的初始 up-front 成本分摊。)

然而,ins.amount 值是每月每小时收取的费用,忽略初始 up-front 费用。根据月度成本粗略计算一个多月,每小时成本约为 ~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.