Skip to main content

cost_allocation_tags

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

Overview

Namecost_allocation_tags
TypeResource
Idaws.ce.cost_allocation_tags

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
last_updated_datestringThe 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_datestringThe 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>)
statusstringThe status of a cost allocation tag. (Active, Inactive)
tag_keystringThe key for the cost allocation tag. (pattern: <code>[\S\s]*</code>)
typestringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
list_cost_allocation_tagsselectregionGet 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_statusupdateregion, CostAllocationTagsStatusUpdates 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_backfillexecregion, BackfillFromRequest 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.

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

SELECT examples

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

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

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 }}"
}'
;