AWS::CE::CostCategory - AWS CloudFormation

AWS::CE::CostCategory

The AWS::CE::CostCategory resource creates groupings of cost that you can use across products in the AWS Billing and Cost Management console, such as Cost Explorer and AWS Budgets. For more information, see Managing Your Costs with Cost Categories in the AWS Billing and Cost Management User Guide.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::CE::CostCategory", "Properties" : { "Name" : String, "Rules" : String, "RuleVersion" : String } }

YAML

Type: AWS::CE::CostCategory Properties: Name: String Rules: String RuleVersion: String

Properties

Name

The unique name of the Cost Category.

Required: Yes

Type: String

Update requires: Replacement

Rules

The array of CostCategoryRule in JSON array format.

Note

Rules are processed in order. If there are multiple rules that match the line item, then the first rule to match is used to determine that Cost Category value.

Required: Yes

Type: String

Maximum: 500

Update requires: No interruption

RuleVersion

The rule schema version in this particular Cost Category.

Required: Yes

Type: String

Update requires: No interruption

Return Values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the Arn of the Cost Category that is created by the template.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

The unique identifier for your Cost Category.

EffectiveStart

The Cost Category's effective start date.

Examples

Cost Category Department with two rules

The following example creates a Cost Category "Department" with two rules.

JSON

{ "CostCategoryDepartment": { "Type": "AWS::CE::CostCategory", "Properties": { "Name": "Department", "RuleVersion": "CostCategoryExpression.v1", "Rules": "[ { \"Value\":\"Engineering\", \"Rule\": { \"Dimensions\": { \"Key\": \"LINKED_ACCOUNT\", \"Values\": [ \"111111111111\" ] } } }, { \"Value\": \"Marketing\", \"Rule\": { \"Dimensions\": { \"Key\": \"LINKED_ACCOUNT\", \"Values\": [ \"222222222222\" ] } } } ]" } } }

YAML

CostCategoryDepartment: Type: 'AWS::CE::CostCategory' Properties: Name: Department RuleVersion: CostCategoryExpression.v1 Rules: ' [ { "Value":"Engineering", "Rule": { "Dimensions": { "Key": "LINKED_ACCOUNT", "Values": [ "111111111111" ] } } }, { "Value":"Marketing", "Rule": { "Dimensions": { "Key": "LINKED_ACCOUNT", "Values": [ "222222222222" ] } } ]'

See Also

  • CostCategory in the AWS Billing and Cost Management API Reference.