Skip to main content

cost_categories

Creates, updates, deletes or gets a cost_category resource or lists cost_categories in a region

Overview

Namecost_categories
TypeResource
DescriptionResource Type definition for AWS::CE::CostCategory. Cost Category enables you to map your cost and usage into meaningful categories. You can use Cost Category to organize your costs using a rule-based engine.
Idawscc.ce.cost_categories

Fields

NameDatatypeDescription
arnstringCost category ARN
effective_startstringISO 8601 date time with offset format
namestring
rule_versionstring
rulesstringJSON array format of Expression in Billing and Cost Management API
split_charge_rulesstringJson array format of CostCategorySplitChargeRule in Billing and Cost Management API
default_valuestringThe default value for the cost category
tagsarrayTags to assign to the cost category.
regionstringAWS region.

For more information, see AWS::CE::CostCategory.

Methods

NameResourceAccessible byRequired Params
create_resourcecost_categoriesINSERTName, RuleVersion, Rules, region
delete_resourcecost_categoriesDELETEIdentifier, region
update_resourcecost_categoriesUPDATEIdentifier, PatchDocument, region
list_resourcescost_categories_list_onlySELECTregion
get_resourcecost_categoriesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual cost_category.

SELECT
region,
arn,
effective_start,
name,
rule_version,
rules,
split_charge_rules,
default_value,
tags
FROM awscc.ce.cost_categories
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.ce.cost_categories (
Name,
RuleVersion,
Rules,
region
)
SELECT
'{{ name }}',
'{{ rule_version }}',
'{{ rules }}',
'{{ region }}';

UPDATE example

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

/*+ update */
UPDATE awscc.ce.cost_categories
SET PatchDocument = string('{{ {
"RuleVersion": rule_version,
"Rules": rules,
"SplitChargeRules": split_charge_rules,
"DefaultValue": default_value,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.ce.cost_categories
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';

Permissions

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

ce:CreateCostCategoryDefinition,
ce:TagResource