Photo by Claudio Schwarz on Unsplash

Part 4: Billing vs. Usage Periods

Christopher Harris
Understanding the AWS CUR
3 min readJun 4, 2024

--

Why do we need both?

My name is Christopher Harris, and I am a maintainer on the FinOps FOCUS project. I’ve built cost management products at Datadog and CloudHealth (Broadcom) over the past 8 years, and I’m excited to share some of what I have learned with you.

The AWS CUR has four-dimensional columns denoting the cost interval of a billing and usage periods. The billing period focuses on reconciling cost and usage to the associated invoice(s) issued, and the usage period focuses on when exactly resources and services were used and charged.

Each period has an inclusive start time and an exclusive end time. In most cases, the billing period encapsulates the start of the usage period, but not always.

Let’s see why.

Billing Period

The billing period is denoted by the interval between bill/BillingPeriodStartDate and bill/BillingPeriodEndDate.

This interval always starts on the first hour of the first day of the month (inclusive) and typically ends with the first hour of the first day of the next month (exclusive). Exceptions to this rule exist and include examples like annual Fees when purchasing All Upfront or Partial Upfront 1-year or 3-year commitments.

As an example of a billing period for May 2024, the following values are set:

  • bill/BillingPeriodStartDate -> 2024–05–01T00:00:00Z
  • bill/BillingPeriodEndDate -> 2024–06–01T00:00:00Z

There is no explicit billing period day or hour allocation … more on this later.

Usage Period

The billing period is denoted by the interval between lineItem/UsageStartDate and lineItem/UsageEndDate.

Unlike the billing period, this interval is quite variable with most values matching the interval of the CUR’s preconfigured granularity (ex: hourly, daily, monthly).

With an hourly granularity, a typical interval starts at one hour (inclusive) and ends at the next (exclusive)

For example, the usage period for May 1, 2024 10:00:00 is:

  • lineItem/UsageStartDate -> 2024–05–01T10:00:00Z
  • lineItem/UsageEndDate -> 2024–05–01T11:00:00Z

Unlike the billing period, the usage period typically contains specific time values, down to the second.

Therefore, the exact billing-allocated time is derived from lineItem/UsageStartDate when the billing period contains the usage start date.

Using the usage values above, if the billing period spans May 2024, the billing-allocated start time is equivalent to the usage-allocated start time.

But what if the periods don’t overlap?

Billing and Usage Period Mismatches

In one specific instance, AWS customers pay a fee to renew Route 53 domains (through AmazonRegistrar) the month before the renewal takes effect. For example, if a domain is renewed on May 19, 2024, its renewal would start on June 1, 2024.

This causes a mismatch between the billing and usage periods within the AWS CUR. The charge period is:

  • lineItem/UsageStartDate -> 2024–05–19T00:00:00Z
  • lineItem/UsageEndDate -> 2024–05–19T01:00:00Z

and the billing period is 1 month later:

  • bill/BillingPeriodStartDate -> 2024–06–01T00:00:00Z
  • bill/BillingPeriodEndDate -> 2024–07–01T00:00:00Z

This mismatch causes a problem for calculating AWS costs since, daily and hourly costs, are allocated to the billing period, not the usage period.

Deriving AWS’ billing-allocated datetime?

In these rare cases where the billing and usage period mismatch, AWS marks the billing period allocation time as the first interval of the billing period’s month.

Given the dates above, the billing-allocated time is derived as 2024–06–01T00:00:00Z, and the customer is invoiced in June 2024.

The formula for determining the billing-allocated time is:

CASE
WHEN YEAR(bill_billing_period_start_date) = YEAR(line_item_usage_start_date)
AND
MONTH(bill_billing_period_start_date) = MONTH(line_item_usage_start_date) THEN
line_item_usage_start_date
ELSE
bill_billing_period_start_date
END AS billing_allocated_date

The only other cost, excluding future Reserved Instances and Savings Plans, I’ve seen with a future billing period is with CloudFront (OCBCloudFront). If you’ve discovered additional examples of billing and usage period mismatches, please comment on this story!

Check out my other stories about Understanding the AWS CUR.

--

--

Christopher Harris
Understanding the AWS CUR

I am a maintainer on the FinOps FOCUS project and have built cost management products at Datadog and CloudHealth (Broadcom) over the past 8 years.