cost_allocation_tags
Creates, updates, deletes, gets or lists a cost_allocation_tags resource.
Overview
| Name | cost_allocation_tags |
| Type | Resource |
| Id | aws.ce.cost_allocation_tags |
Fields
The following fields are returned by SELECT queries:
- list_cost_allocation_tags
| Name | Datatype | Description |
|---|---|---|
last_updated_date | string | The period of time that you want the usage and costs for. (pattern: <code>^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$</code>) |
last_used_date | string | The period of time that you want the usage and costs for. (pattern: <code>^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$</code>) |
status | string | The status of a cost allocation tag. (Active, Inactive) |
tag_key | string | The key for the cost allocation tag. (pattern: <code>[\S\s]*</code>) |
type | string | The type of cost allocation tag. You can use AWSGenerated or UserDefined type tags. AWSGenerated type tags are tags that Amazon Web Services defines and applies to support Amazon Web Services resources for cost allocation purposes. UserDefined type tags are tags that you define, create, and apply to resources. (AWSGenerated, UserDefined) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_cost_allocation_tags | select | region | Get a list of cost allocation tags. All inputs in the API are optional and serve as filters. By default, all cost allocation tags are returned. | |
update_cost_allocation_tags_status | update | region, CostAllocationTagsStatus | Updates status for cost allocation tags in bulk, with maximum batch size of 20. If the tag status that's updated is the same as the existing tag status, the request doesn't fail. Instead, it doesn't have any effect on the tag status (for example, activating the active tag). | |
start_cost_allocation_tag_backfill | exec | region, BackfillFrom | Request a cost allocation tag backfill. This will backfill the activation status (either active or inactive) for all tag keys from para:BackfillFrom up to the time this request is made. You can request a backfill once every 24 hours. |
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
- list_cost_allocation_tags
Get a list of cost allocation tags. All inputs in the API are optional and serve as filters. By default, all cost allocation tags are returned.
SELECT
last_updated_date,
last_used_date,
status,
tag_key,
type
FROM aws.ce.cost_allocation_tags
WHERE region = '{{ region }}' -- required
;
UPDATE examples
- update_cost_allocation_tags_status
Updates status for cost allocation tags in bulk, with maximum batch size of 20. If the tag status that's updated is the same as the existing tag status, the request doesn't fail. Instead, it doesn't have any effect on the tag status (for example, activating the active tag).
UPDATE aws.ce.cost_allocation_tags
SET
CostAllocationTagsStatus = '{{ CostAllocationTagsStatus }}'
WHERE
region = '{{ region }}' --required
AND CostAllocationTagsStatus = '{{ CostAllocationTagsStatus }}' --required
RETURNING
errors;
Lifecycle Methods
- start_cost_allocation_tag_backfill
Request a cost allocation tag backfill. This will backfill the activation status (either active or inactive) for all tag keys from para:BackfillFrom up to the time this request is made. You can request a backfill once every 24 hours.
EXEC aws.ce.cost_allocation_tags.start_cost_allocation_tag_backfill
@region='{{ region }}' --required
@@json=
'{
"BackfillFrom": "{{ BackfillFrom }}"
}'
;