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 = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all billing_views in a region.
SELECT
region,
arn
FROM awscc.billing.billing_views_list_only
WHERE
region = 'us-east-1';
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 }}';
/*+ create */
INSERT INTO awscc.billing.billing_views (
DataFilterExpression,
Description,
Name,
Tags,
SourceViews,
region
)
SELECT
'{{ data_filter_expression }}',
'{{ description }}',
'{{ name }}',
'{{ tags }}',
'{{ source_views }}',
'{{ region }}';
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.billing.billing_views
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
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