cost_and_usage_with_resources
Creates, updates, deletes, gets or lists a cost_and_usage_with_resources resource.
Overview
| Name | cost_and_usage_with_resources |
| Type | Resource |
| Id | aws.ce.cost_and_usage_with_resources |
Fields
The following fields are returned by SELECT queries:
- get_cost_and_usage_with_resources
| Name | Datatype | Description |
|---|---|---|
dimension_value_attributes | array | The attributes that apply to a specific dimension value. For example, if the value is a linked account, the attribute is that account name. |
group_definitions | array | The groups that are specified by the Filter or GroupBy parameters in the request. |
next_page_token | string | The 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_time | array | The time period that's covered by the results in the response. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_cost_and_usage_with_resources | select | region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_cost_and_usage_with_resources
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
;