Skip to main content

billing_views

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

Overview

Namebilling_views
TypeResource
Idaws.billing.billing_views

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe account name of the billing view. (pattern: <code>[ a-zA-Z0-9_+=.-@]+</code>)
arnstringThe 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_typestringThe type of billing group. (PRIMARY, BILLING_GROUP, CUSTOM, BILLING_TRANSFER, BILLING_TRANSFER_SHOWBACK)
created_atstring (date-time)The time when the billing view was created.
data_filter_expressionobjectSee Expression. Billing view only supports LINKED_ACCOUNT, Tags, and CostCategories.
derived_view_countintegerThe number of billing views that use this billing view as a source.
descriptionstringThe description of the billing view. (pattern: <code>([ a-zA-Z0-9_+=.-@]+)?</code>)
health_statusobjectThe current health status of the billing view.
owner_account_idstringThe account owner of the billing view. (pattern: <code>[0-9]{12}</code>)
source_account_idstringThe 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_countintegerThe number of source views associated with this billing view.
updated_atstring (date-time)The time when the billing view was last updated.
view_definition_last_updated_atstring (date-time)The timestamp of when the billing view definition was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_billing_viewselectregionReturns the metadata associated to the specified billing view ARN.
list_billing_viewsselectregionLists 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_viewinsertregion, name, sourceViewsCreates a billing view with the specified billing view attributes.
update_billing_viewupdateregion, arnAn API to update the attributes of the billing view.
delete_billing_viewdeleteregionDeletes 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.

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

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

Deletes the specified billing view.

DELETE FROM aws.billing.billing_views
WHERE region = '{{ region }}' --required
;