AWS Cost Explorer Service

2024/02/28 - AWS Cost Explorer Service - 1 new api methods

Changes  This release introduces the new API 'GetApproximateUsageRecords', which retrieves estimated usage records for hourly granularity or resource-level data at daily granularity.

GetApproximateUsageRecords (new) Link ΒΆ

Retrieves estimated usage records for hourly granularity or resource-level data at daily granularity.

See also: AWS API Documentation

Request Syntax

client.get_approximate_usage_records(
    Granularity='DAILY'|'MONTHLY'|'HOURLY',
    Services=[
        'string',
    ],
    ApproximationDimension='SERVICE'|'RESOURCE'
)
type Granularity

string

param Granularity

[REQUIRED]

How granular you want the data to be. You can enable data at hourly or daily granularity.

type Services

list

param Services

The service metadata for the service or services you want to query. If not specified, all elements are returned.

  • (string) --

type ApproximationDimension

string

param ApproximationDimension

[REQUIRED]

The service to evaluate for the usage records. You can choose resource-level data at daily granularity, or hourly granularity with or without resource-level data.

rtype

dict

returns

Response Syntax

{
    'Services': {
        'string': 123
    },
    'TotalRecords': 123,
    'LookbackPeriod': {
        'Start': 'string',
        'End': 'string'
    }
}

Response Structure

  • (dict) --

    • Services (dict) --

      The service metadata for the service or services in the response.

      • (string) --

        • (integer) --

    • TotalRecords (integer) --

      The total number of usage records for all services in the services list.

    • LookbackPeriod (dict) --

      The lookback period that's used for the estimation.

      • Start (string) --

        The beginning of the time period. The start date is inclusive. For example, if start is 2017-01-01 , Amazon Web Services retrieves cost and usage data starting at 2017-01-01 up to the end date. The start date must be equal to or no later than the current date to avoid a validation error.

      • End (string) --

        The end of the time period. The end date is exclusive. For example, if end is 2017-05-01 , Amazon Web Services retrieves cost and usage data from the start date up to, but not including, 2017-05-01 .