Skip to main content

billing_views

Creates, updates, deletes or gets a billing_view resource or lists billing_views in a region

Overview

Namebilling_views
TypeResource
DescriptionA billing view is a container of cost & usage metadata.
Idawscc.billing.billing_views

Fields

NameDatatypeDescription
arnstring
billing_view_typestring
data_filter_expressionobject
created_atnumberThe time when the billing view was created.
descriptionstring
namestring
owner_account_idstring
tagsarrayAn array of key-value pairs associated to the billing view being created.
source_viewsarrayAn array of strings that define the billing view's source.
updated_atnumberThe time when the billing view was last updated.
regionstringAWS region.

For more information, see AWS::Billing::BillingView.

Methods

NameResourceAccessible byRequired Params
create_resourcebilling_viewsINSERTName, SourceViews, region
delete_resourcebilling_viewsDELETEIdentifier, region
update_resourcebilling_viewsUPDATEIdentifier, PatchDocument, region
list_resourcesbilling_views_list_onlySELECTregion
get_resourcebilling_viewsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual billing_view.

SELECT
region,
arn,
billing_view_type,
data_filter_expression,
created_at,
description,
name,
owner_account_id,
tags,
source_views,
updated_at
FROM awscc.billing.billing_views
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new billing_view resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.billing.billing_views (
Name,
SourceViews,
region
)
SELECT
'{{ name }}',
'{{ source_views }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a billing_view resource, using stack-deploy.

/*+ update */
UPDATE awscc.billing.billing_views
SET PatchDocument = string('{{ {
"DataFilterExpression": data_filter_expression,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.billing.billing_views
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the billing_views resource, the following permissions are required:

billing:CreateBillingView,
billing:TagResource,
billing:ListTagsForResource,
billing:GetBillingView,
billing:ListSourceViewsForBillingView