Skip to main content

cost_and_usage_with_resources

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

Overview

Namecost_and_usage_with_resources
TypeResource
Idaws.ce.cost_and_usage_with_resources

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_usage_with_resourcesselectregionRetrieves cost and usage metrics with resources for your account. You can specify which cost and usage-related metric, such as BlendedCosts or UsageQuantity, that you want the request to return. 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. Hourly granularity is only available for EC2-Instances (Elastic Compute Cloud) resource-level data. All other resource-level data is available at daily granularity. This is an opt-in only feature. You can enable this feature from the Cost Explorer Settings page. For information about how to access the Settings page, see Controlling Access for Cost Explorer 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 with resources for your account. You can specify which cost and usage-related metric, such as BlendedCosts or UsageQuantity, that you want the request to return. 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. Hourly granularity is only available for EC2-Instances (Elastic Compute Cloud) resource-level data. All other resource-level data is available at daily granularity. This is an opt-in only feature. You can enable this feature from the Cost Explorer Settings page. For information about how to access the Settings page, see Controlling Access for Cost Explorer 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_usage_with_resources
WHERE region = '{{ region }}' -- required
;