billing_views
Creates, updates, deletes or gets a billing_view resource or lists billing_views in a region
Overview
| Name | billing_views |
| Type | Resource |
| Description | A billing view is a container of cost & usage metadata. |
| Id | awscc.billing.billing_views |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | |
billing_view_type | string | |
data_filter_expression | object | |
created_at | number | The time when the billing view was created. |
description | string | |
name | string | |
owner_account_id | string | |
tags | array | An array of key-value pairs associated to the billing view being created. |
source_views | array | An array of strings that define the billing view's source. |
updated_at | number | The time when the billing view was last updated. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | |
region | string | AWS region. |
For more information, see AWS::Billing::BillingView.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | billing_views | INSERT | Name, SourceViews, region |
delete_resource | billing_views | DELETE | Identifier, region |
update_resource | billing_views | UPDATE | Identifier, PatchDocument, region |
list_resources | billing_views_list_only | SELECT | region |
get_resource | billing_views | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all billing_views in a region.
SELECT
region,
arn
FROM awscc.billing.billing_views_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new billing_view resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ 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
;
/*+ create */
INSERT INTO awscc.billing.billing_views (
DataFilterExpression,
Description,
Name,
Tags,
SourceViews,
region
)
SELECT
'{{ data_filter_expression }}',
'{{ description }}',
'{{ name }}',
'{{ tags }}',
'{{ source_views }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: billing_view
props:
- name: data_filter_expression
value:
dimensions:
key: '{{ key }}'
values:
- '{{ values[0] }}'
tags:
key: '{{ key }}'
values:
- '{{ values[0] }}'
- name: description
value: '{{ description }}'
- name: name
value: '{{ name }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: source_views
value:
- '{{ source_views[0] }}'
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:
| Parameter | Description |
|---|---|
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:
- Create
- Read
- Update
- Delete
- List
billing:CreateBillingView,
billing:TagResource,
billing:ListTagsForResource,
billing:GetBillingView,
billing:ListSourceViewsForBillingView
billing:GetBillingView,
billing:ListTagsForResource,
billing:ListSourceViewsForBillingView
billing:UpdateBillingView,
billing:GetBillingView,
billing:ListTagsForResource,
billing:TagResource,
billing:UntagResource,
billing:ListSourceViewsForBillingView
billing:GetBillingView,
billing:DeleteBillingView
billing:ListBillingViews