CreateCostCategoryDefinition - AWS Cost Explorer Service

CreateCostCategoryDefinition

Important

Cost Category is in public beta for AWS Billing and Cost Management and is subject to change. Your use of Cost Categories is subject to the Beta Service Participation terms of the AWS Service Terms (Section 1.10).

Creates a new Cost Category with the requested name and rules.

Request Syntax

{ "Name": "string", "Rules": [ { "Rule": { "And": [ "Expression" ], "CostCategories": { "Key": "string", "Values": [ "string" ] }, "Dimensions": { "Key": "string", "Values": [ "string" ] }, "Not": "Expression", "Or": [ "Expression" ], "Tags": { "Key": "string", "Values": [ "string" ] } }, "Value": "string" } ], "RuleVersion": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Name

The unique name of the Cost Category.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: ^(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )$

Required: Yes

Rules

CreateCostCategoryDefinition supports dimensions, Tags, and nested expressions. Currently the only dimensions supported is LINKED_ACCOUNT.

Root level OR is not supported. We recommend you create a separate rule instead.

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.

Type: Array of CostCategoryRule objects

Array Members: Minimum number of 1 item. Maximum number of 500 items.

Required: Yes

RuleVersion

The rule schema version in this particular Cost Category.

Type: String

Valid Values: CostCategoryExpression.v1

Required: Yes

Response Syntax

{ "CostCategoryArn": "string", "EffectiveStart": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

CostCategoryArn

The unique identifier for your newly created Cost Category.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+

EffectiveStart

The Cost Category's effective start date.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 25.

Pattern: ^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(([+-]\d\d:\d\d)|Z)$

Errors

For information about the errors that are common to all actions, see Common Errors.

LimitExceededException

You made too many calls in a short period of time. Try again later.

HTTP Status Code: 400

ServiceQuotaExceededException

You've reached the limit on the number of resources you can create, or exceeded the size of an individual resources.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: