Exploring AWS Cost and Usage Report (CUR)

Amazon Web Services (AWS) uses a pay-as-you-go model in which the user is billed only for what they use. The daily usage status and billing amount can be checked using the cost management tools provided by AWS or other third-party tools. However, to obtain the exact amount spent by any certain condition or multiple conditions, e.g. the amount spent for a specific department or project within a certain period, or by instance type, you need to refer to much more detailed usage data. The detailed usage data can be obtained via API or the AWS Cost and Usage Report (commonly known as CUR) which is explained in this article.

What is the CUR

The “most comprehensive set of cost and usage data available,” as described by AWS. The CUR contains a large amount of detailed and vast data about AWS costs. The CUR will be created by setting from the AWS console. You can access the settings page from the “Get started” link o AWS’s CUR introduction page.

The CUR file is large because it aggregates/contains a lot of information. Hence, it is not efficient to download and utilize the CSV file as is. The standard method is to deliver the CUR file to an Amazon Simple Storage Service (Amazon S3) bucket before processing the data.

Features/Characteristics

    1. Data for all the member accounts under the organization retrieved once set in the payer account
    2. Can be set for each member account
    3. Hourly or daily data available
    4. Amounts stated in US Dollars
    5. A CSV file delivered per month

Information that can be Obtained from the CUR

The CUR contains more than 300 items, with new items being added and specification changed from time to time. The table below lists the main items that are considered to be effective for data utilization.

ItemAWS documentation commentarySupplement
payerPayer account ID
bill_invoiceidBilling ID. The ID of the invoice actually issued by AWS and each item match.
lineitem_usageaccountidThe ID of the account that used this line item. For organizations, this can be either an administrative account or a member account. You can use this field to track costs and usage by account.
lineitem_lineitemtypeThe type of claim covered by this line item. The following types are applicable.Item examples:

Credit — The credit that AWS applies to your bill

DiscountedUsage — Items with Reserved Instance (RI) discounts

Fee — A prepaid annual fee paid for your subscription

Refund — Refund from AWS

RIFee — Subscription recurring monthly fee.

Tax — Tax

Usage — Usage charges charged at the on-demand instance rate

SavingsPlanUpfrontFee — Prepaid charges for purchasing the Savings Plans

SavingsPlanRecurringFee — Hourly recurring rates for non-prepaid or partial prepaid Savings Plans.

SavingsPlanCoveredUsage— On-demand costs covered by the Savings Plans. Usage line items covered by the Savings Plans are offset by the corresponding SavingsPlanNegation.
lineitem_usagestartdateThe start date and time of the line item is expressed in UTC (including that time). The format is YYYY-MM-DDTHH: mm: ssZ.
lineitem_usageenddateThe end date and time of the corresponding line item is expressed in UTC (not including that time). The format is YYYY-MM-DDTHH: mm: ssZ.
lineitem_productcodeThe code of the measured product. For example, Amazon EC2 is the product code for Amazon Elastic Compute Cloud.
lineitem_usagetypeUsage details for this item. For example, USW2-BoxUsage: m2.2xlarge describes an M2 high memory double extra large instance in the US West (Oregon) region.
lineitem_operationThe specific AWS operation that is the subject of this line item. This represents the specific usage of the line item. For example, the value of RunInstances indicates the operation of your Amazon EC2 instance.
lineitem_availabilityzoneThe availability zone that hosts this item. For example, us-east-1a, us-east-1b.
lineitem_resourceid(Optional) If you choose to include individual resource IDs in your report, this column shows the IDs of the provisioned resources.
lineitem_usageamountUsage incurred during the specified period.
lineitem_normalizationfactorAs long as the instances share tenancy, AWS can apply Amazon EC2 and Amazon RDS RI discounts on Linux or Unix for all instance sizes in the instance family. AWS region. This also applies to RI discounts for member accounts within your organization. All new and existing Amazon EC2 and Amazon RDS size flexible RI sizes are determined by a normalization factor based on instance size. The following table shows the normalization factors that AWS applies to each instance size.
lineitem_unblendedrateUncombined percentage for a particular use. UnblendedRate is 0 if the line item has a RI discount applied. LineItemType is Discounted Usage for line items to which RI discount is applied.
lineitem_unblendedcostUnblendedCost is the value of UnblendedRate multiplied by UsageAmount.
lineitem_lineitemdescriptionA description of the line item type. For example, a usage fee line item summarizes the types of usage that occurred over a particular time period.
lineitem_netunblendedrateFor size-flexible RIs, the description corresponds to the RI to which the benefits apply. For example, if the line item corresponds to t2.micro and t2.small RI is applied for its use, lineitem / description will display t2.small.
lineitem_legalentityThe description of the line item for the usage fee to which the RI discount is applied includes the rate plan covered by the line item.
pricing_publicondemandcostAmount when the line item is calculated as an on-demand cost
reservation_endtime-RI expiration date and time
reservation_reservationarn-ARN of ReservedInstance. It's like a unique ID for each Savings Plans you purchased.
reservation_starttime-RI deadline start date and time
savingsplan_savingsplanarn-Savings Plans ARN. It's like a unique ID for each Savings Plans you purchased.
savingsplan_starttime-SP start time date and time
savingsplan_endtime-SP deadline date and time

*For further explanation of the AWS document, refer to Line item details.

Applying CUR to Actual Scenarios

You will be able to retrieve the data you want by extracting or multiplying specific items in the CUR according to the conditions. Here are some examples.

1. ​​Calculate the on-demand usage fee for a specific account.

    a. Specify the account ID with lineitem_usageaccountid
    b. Specify Usage with lineitem_lineitemtype
    c. Sum up the amount of lineitem_unblendedcost that meets the conditions of a and b

2. ​​Calculate the EC2 on-demand usage fee for a specific account.

    a. Specify the account ID with lineitem_usageaccountid
    b. Specify Usage with lineitem_lineitemtype
    c. Specify Amazon EC2 with lineitem_productcode
    d. Sum up the amount of lineitem_unblendedcost that meets the conditions of a, b, and c

3. Calculate usage for a particular instance.

    a. Specify the Instance ID with lineitem_resourceid
    b. Sum up the amount of lineitem_usageamount that meets the condition of a

Summary

Understanding the accurate costs on cloud is the first and necessary step for “unboxing” the complicated spend for cloud computing from the black box and optimizing your investment in cloud. The CUR helps you identify accurate and detailed cost and usage data at any level of granularity or in any groups. Using it in combination with native cloud vendor tools or third-party tools will help you understand cloud costs more efficiently.

About the Author

Rena Mochizuki

Principal Customer Success Manager

Contact Us

    Related Posts