billing_views
Creates, updates, deletes, gets or lists a billing_views resource.
Overview
| Name | billing_views |
| Type | Resource |
| Id | aws.billing.billing_views |
Fields
The following fields are returned by SELECT queries:
- get_billing_view
- list_billing_views
| Name | Datatype | Description |
|---|---|---|
name | string | The account name of the billing view. (pattern: <code>[ a-zA-Z0-9_+=.-@]+</code>) |
arn | string | The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. (pattern: <code>arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[a-zA-Z0-9/:_+=.-@]{0,75}[a-zA-Z0-9]</code>) |
billing_view_type | string | The type of billing group. (PRIMARY, BILLING_GROUP, CUSTOM, BILLING_TRANSFER, BILLING_TRANSFER_SHOWBACK) |
created_at | string (date-time) | The time when the billing view was created. |
data_filter_expression | object | See Expression. Billing view only supports LINKED_ACCOUNT, Tags, and CostCategories. |
derived_view_count | integer | The number of billing views that use this billing view as a source. |
description | string | The description of the billing view. (pattern: <code>([ a-zA-Z0-9_+=.-@]+)?</code>) |
health_status | object | The current health status of the billing view. |
owner_account_id | string | The account owner of the billing view. (pattern: <code>[0-9]{12}</code>) |
source_account_id | string | The Amazon Web Services account ID that owns the source billing view, if this is a derived billing view. (pattern: <code>[0-9]{12}</code>) |
source_view_count | integer | The number of source views associated with this billing view. |
updated_at | string (date-time) | The time when the billing view was last updated. |
view_definition_last_updated_at | string (date-time) | The timestamp of when the billing view definition was last updated. |
| Name | Datatype | Description |
|---|---|---|
name | string | A list of names of the Billing view. (pattern: <code>[ a-zA-Z0-9_+=.-@]+</code>) |
arn | string | The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. (pattern: <code>arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[a-zA-Z0-9/:_+=.-@]{0,75}[a-zA-Z0-9]</code>) |
billing_view_type | string | The type of billing view. (PRIMARY, BILLING_GROUP, CUSTOM, BILLING_TRANSFER, BILLING_TRANSFER_SHOWBACK) |
description | string | The description of the billing view. (pattern: <code>([ a-zA-Z0-9_+=.-@]+)?</code>) |
health_status | object | The current health status of the billing view. |
owner_account_id | string | The list of owners of the Billing view. (pattern: <code>[0-9]{12}</code>) |
source_account_id | string | The Amazon Web Services account ID that owns the source billing view, if this is a derived billing view. (pattern: <code>[0-9]{12}</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_billing_view | select | region | Returns the metadata associated to the specified billing view ARN. | |
list_billing_views | select | region | Lists the billing views available for a given time period. Every Amazon Web Services account has a unique PRIMARY billing view that represents the billing data available by default. Accounts that use Billing Conductor also have BILLING_GROUP billing views representing pro forma costs associated with each created billing group. | |
create_billing_view | insert | region, name, sourceViews | Creates a billing view with the specified billing view attributes. | |
update_billing_view | update | region, arn | An API to update the attributes of the billing view. | |
delete_billing_view | delete | region | Deletes the specified billing view. |
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_billing_view
- list_billing_views
Returns the metadata associated to the specified billing view ARN.
SELECT
name,
arn,
billing_view_type,
created_at,
data_filter_expression,
derived_view_count,
description,
health_status,
owner_account_id,
source_account_id,
source_view_count,
updated_at,
view_definition_last_updated_at
FROM aws.billing.billing_views
WHERE region = '{{ region }}' -- required
;
Lists the billing views available for a given time period. Every Amazon Web Services account has a unique PRIMARY billing view that represents the billing data available by default. Accounts that use Billing Conductor also have BILLING_GROUP billing views representing pro forma costs associated with each created billing group.
SELECT
name,
arn,
billing_view_type,
description,
health_status,
owner_account_id,
source_account_id
FROM aws.billing.billing_views
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_billing_view
- Manifest
Creates a billing view with the specified billing view attributes.
INSERT INTO aws.billing.billing_views (
name,
description,
sourceViews,
dataFilterExpression,
clientToken,
resourceTags,
region
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ sourceViews }}' /* required */,
'{{ dataFilterExpression }}',
'{{ clientToken }}',
'{{ resourceTags }}',
'{{ region }}'
RETURNING
arn,
created_at
;
# Description fields are for documentation purposes
- name: billing_views
props:
- name: region
value: "{{ region }}"
description: Required parameter for the billing_views resource.
- name: name
value: "{{ name }}"
description: |
The name of the billing view.
- name: description
value: "{{ description }}"
description: |
The description of the billing view.
- name: sourceViews
value:
- "{{ sourceViews }}"
description: |
A list of billing views used as the data source for the custom billing view.
- name: dataFilterExpression
description: |
See Expression. Billing view only supports LINKED_ACCOUNT, Tags, and CostCategories.
value:
dimensions:
key: "{{ key }}"
values:
- "{{ values }}"
tags:
key: "{{ key }}"
values:
- "{{ values }}"
costCategories:
key: "{{ key }}"
values:
- "{{ values }}"
timeRange:
beginDateInclusive: "{{ beginDateInclusive }}"
endDateInclusive: "{{ endDateInclusive }}"
- name: clientToken
value: "{{ clientToken }}"
description: |
A unique, case-sensitive identifier you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. If the original request completes successfully, any subsequent retries complete successfully without performing any further actions with an idempotent request.
- name: resourceTags
description: |
A list of key value map specifying tags associated to the billing view being created.
value:
- key: "{{ key }}"
value: "{{ value }}"
UPDATE examples
- update_billing_view
An API to update the attributes of the billing view.
UPDATE aws.billing.billing_views
SET
arn = '{{ arn }}',
name = '{{ name }}',
description = '{{ description }}',
dataFilterExpression = '{{ dataFilterExpression }}'
WHERE
region = '{{ region }}' --required
AND arn = '{{ arn }}' --required
RETURNING
arn,
updated_at;
DELETE examples
- delete_billing_view
Deletes the specified billing view.
DELETE FROM aws.billing.billing_views
WHERE region = '{{ region }}' --required
;