AWS Cost Explorer API returning negative costs starting 1. April 2024

0

Hi,

I've had a small service running daily to monitor my AWS costs. Early April this year (2024) it appears to have began returning negative numbers for my BlendedCost metric. This service has been connected to EventBridge and ran daily for a few months, without any problems until now.

Granularity report with negative amount

The SDK call I use translates to aws ce get-cost-and-usage --granularity DAILY --metrics BlendedCost --time-period Start=2024-04-01,End=2024-04-26, and querying for the exact same granularity and metrics with --time-period Start=2024-03-01,End=2024-04-01 gives me my costs as expected.

My AWS account does not have any credits, but its bill is paid through consolidated billing through an organization. Maybe this is relevant? Is there any other factors that could apply?

My account has a relatively low spend (around $2-5 per month), but I don't understand why any number would be negative. My daily request to the cost explorer API on its own should incur a non-negative spend.

In any case, does anybody know of a way to work around this, because the AWS dashboard still shows the granularities just fine. Maybe I just need a new query? In any case I was surprised that my service suddenly started returning strange values.

Thanks!

asked 11 days ago65 views
1 Answer
0
Accepted Answer

In this blog, Blended costs were originally created to support customers who chose to consolidate their billing under a single paying account. Nowadays, these costs are not used frequently due to the way that they are calculated. Blended costs are calculated by multiplying each account’s service usage against something called a blended rate. A blended rate is the average rate of on-demand usage, as well as Savings Plans- and reservation-related usage, that is consumed by member accounts in an organization for a particular service.

If you change the metric to Unblended Cost, do you also see negative value? Also have you compared between Blended Cost vs Unblended Cost in Cost Explorer by setting "Aggregate costs by" under Advanced options? What if you exclude "Credit" and "Refund" under "Charge type" ?

profile pictureAWS
EXPERT
answered 8 days ago
  • Thanks for the thorough explanation. I'll try your suggestions, but I also noticed that the numbers went back to normal two days ago (on the 29th.). I'll hear with my organisation and see if they maybe changed something.

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.

Guidelines for Answering Questions