Skip to main content

cost_and_usages

Creates, updates, deletes, gets or lists a cost_and_usages resource.

Overview

Namecost_and_usages
TypeResource
Idaws.ce.cost_and_usages

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
dimension_value_attributesarrayThe attributes that apply to a specific dimension value. For example, if the value is a linked account, the attribute is that account name.
group_definitionsarrayThe groups that are specified by the Filter or GroupBy parameters in the request.
next_page_tokenstringThe token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size. (pattern: <code>[\S\s]*</code>)
results_by_timearrayThe time period that's covered by the results in the response.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_cost_and_usageselectregionRetrieves cost and usage metrics for your account. You can specify which cost and usage-related metric that you want the request to return. For example, you can specify BlendedCosts or UsageQuantity. You can also filter and group your data by various dimensions, such as SERVICE or AZ, in a specific time range. For a complete list of valid dimensions, see the GetDimensionValues operation. Management account in an organization in Organizations have access to all member accounts. For information about filter limitations, see Quotas and restrictions in the Billing and Cost Management User Guide.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves cost and usage metrics for your account. You can specify which cost and usage-related metric that you want the request to return. For example, you can specify BlendedCosts or UsageQuantity. You can also filter and group your data by various dimensions, such as SERVICE or AZ, in a specific time range. For a complete list of valid dimensions, see the GetDimensionValues operation. Management account in an organization in Organizations have access to all member accounts. For information about filter limitations, see Quotas and restrictions in the Billing and Cost Management User Guide.

SELECT
dimension_value_attributes,
group_definitions,
next_page_token,
results_by_time
FROM aws.ce.cost_and_usages
WHERE region = '{{ region }}' -- required
;