Skip to content

Discrepancy between CUR and cost explorer due to RIFee

0

Hi folks,** need you help with amortization question.**

In cost explorer, in amortized cost mode, I don't see a spike in the data on the RI purchase date while in my query I do. I want to have a query that reflects the exact situation as in cost explorer. How can I amortize the RIFees as well? Query source

Query:

SELECT line_item_line_item_type, SUM(CASE
        WHEN (line_item_line_item_type = 'SavingsPlanCoveredUsage') THEN savings_plan_savings_plan_effective_cost 
        WHEN (line_item_line_item_type = 'SavingsPlanRecurringFee') THEN (savings_plan_total_commitment_to_date - savings_plan_used_commitment) 
        WHEN (line_item_line_item_type = 'SavingsPlanNegation') THEN 0
        WHEN (line_item_line_item_type = 'SavingsPlanUpfrontFee') THEN 0
        WHEN (line_item_line_item_type = 'DiscountedUsage') THEN reservation_effective_cost  
        WHEN (line_item_line_item_type = 'RIFee') THEN (reservation_unused_amortized_upfront_fee_for_billing_period + reservation_unused_recurring_fee)
        WHEN ((line_item_line_item_type = 'Fee') AND (reservation_reservation_a_r_n <> '')) THEN 0 
        ELSE line_item_unblended_cost 
      END ) AS amortized_cost
       FROM $my_table
WHERE
 line_item_usage_start_date >= '2024-12-01' AND  line_item_usage_start_date < '2024-12-10'

Thanks!

3 Answers
1
Accepted Answer

The discrepancy you're seeing between the Cost Explorer and your query results regarding Reserved Instance (RI) fees is due to how amortization is handled. In Cost Explorer's amortized view, RI fees are spread evenly across the commitment term, which is why you don't see a spike on the purchase date.

To align your query with Cost Explorer's amortized view, you need to modify how you handle the RIFee line item type. Instead of including the full unused fees in your calculation, you should amortize these costs over the term of the reservation.

Here's how you can modify your query to better reflect the amortized costs as shown in Cost Explorer:

  1. For the 'RIFee' line item, instead of using: (reservation_unused_amortized_upfront_fee_for_billing_period + reservation_unused_recurring_fee)

    You should use: (reservation_amortized_upfront_fee_for_billing_period + reservation_effective_cost)

  2. You may also want to include the 'Fee' line item related to RIs in your amortization calculation.

With these changes, your query should more closely match the amortized view in Cost Explorer, distributing the RI costs evenly across the term rather than showing a spike on the purchase date.

Remember that the exact amortization schedule in Cost Explorer might differ slightly from what you can achieve with a custom query, as Cost Explorer uses specific algorithms to spread costs. However, this approach should give you a closer approximation.

Also, keep in mind that your accounting policies may dictate a different amortization schedule than what's shown in AWS Cost Explorer. Some organizations may choose to amortize purchases on an even monthly schedule, while others might use different accounting periods. Ensure that your query aligns with your organization's specific accounting practices if they differ from the default AWS amortization.
Sources
Knowing the differences between Billing and Cost Explorer data - AWS Cost Management
Aligning Cloud Costs with the General Ledger for Accurate Financial Analysis | AWS Cloud Financial Management

answered 2 years ago

AWS
EXPERT

reviewed 2 years ago

AWS
EXPERT

reviewed 2 years ago

  • Thanks agent + team, do you maybe have a full query for CUR that it's results will match the amortized cost explorer results exactly? Is it the above query with the suggested RIFee change or there is anything else?

0

Hi team, if anyone can answer the above comment it'll be amazing - do you maybe have a full query for CUR that it's results will match the amortized cost explorer results exactly?

answered 2 years ago

0

Hi team,

I'm confused by your suggestion to sum reservation_amortized_upfront_fee_for_billing_period + reservation_effective_cost under RIFee line items because the documentation here https://docs.aws.amazon.com/cur/latest/userguide/reservation-columns.html states that reservation_effective_cost is calculated by taking the amortizedUpfrontCostForUsage and adding it to the recurringFeeForUsage. So it seems to me that:

  1. reservation_effective_cost is only populated for usage, and doesn't capture unused RI fees
  2. Adding reservation_amortized_upfront_fee_for_billing_period would double count the amortized upfront fee

Could you confirm if I'm missing something?

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.