cost_and_usages
Creates, updates, deletes, gets or lists a cost_and_usages resource.
Overview
| Name | cost_and_usages |
| Type | Resource |
| Id | aws.ce.cost_and_usages |
Fields
The following fields are returned by SELECT queries:
- get_cost_and_usage
| 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 | select | region | 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. |
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
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
;