Skip to content

Resource: awsCeCostCategory

Provides a CE Cost Category.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.ceCostCategory.CeCostCategory(this, "test", {
  name: "NAME",
  rule: [
    {
      rule: {
        dimension: {
          key: "LINKED_ACCOUNT_NAME",
          matchOptions: ["ENDS_WITH"],
          values: ["-prod"],
        },
      },
      value: "production",
    },
    {
      rule: {
        dimension: {
          key: "LINKED_ACCOUNT_NAME",
          matchOptions: ["ENDS_WITH"],
          values: ["-stg"],
        },
      },
      value: "staging",
    },
    {
      rule: {
        dimension: {
          key: "LINKED_ACCOUNT_NAME",
          matchOptions: ["ENDS_WITH"],
          values: ["-dev"],
        },
      },
      value: "testing",
    },
  ],
  ruleVersion: "CostCategoryExpression.v1",
});

Argument Reference

The following arguments are required:

  • name - (Required) Unique name for the Cost Category.
  • rule - (Required) Configuration block for the Cost Category rules used to categorize costs. See below.
  • ruleVersion - (Required) Rule schema version in this particular Cost Category.
  • effectiveStart- (Optional) The Cost Category's effective start date. It can only be a billing start date (first day of the month). If the date isn't provided, it's the first day of the current month. Dates can't be before the previous twelve months, or in the future. For example 20221101T00:00:00Z.

The following arguments are optional:

  • defaultValue - (Optional) Default value for the cost category.
  • splitChargeRule - (Optional) Configuration block for the split charge rules used to allocate your charges between your Cost Category values. See below.
  • tags - (Optional) Key-value mapping of resource tags. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

rule

  • inheritedValue - (Optional) Configuration block for the value the line item is categorized as if the line item contains the matched dimension. See below.
  • rule - (Optional) Configuration block for the expression object used to categorize costs. See below.
  • type - (Optional) You can define the CostCategoryRule rule type as either regular or INHERITED_VALUE.
  • value - (Optional) Default value for the cost category.

inheritedValue

  • dimensionKey - (Optional) Key to extract cost category values.
  • dimensionName - (Optional) Name of the dimension that's used to group costs. If you specify LINKED_ACCOUNT_NAME, the cost category value is based on account name. If you specify tag, the cost category value will be based on the value of the specified tag key. Valid values are LINKED_ACCOUNT_NAME, tag

rule

  • and - (Optional) Return results that match both dimension objects.
  • costCategory - (Optional) Configuration block for the filter that's based on costCategory values. See below.
  • dimension - (Optional) Configuration block for the specific dimension to use for expression. See below.
  • not - (Optional) Return results that match both dimension object.
  • or - (Optional) Return results that match both dimension object.
  • tags - (Optional) Configuration block for the specific tag to use for expression. See below.

costCategory

  • key - (Optional) Unique name of the Cost Category.
  • matchOptions - (Optional) Match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for MatchOptions is equals and CASE_SENSITIVE. Valid values are: equals, absent, STARTS_WITH, ENDS_WITH, contains, CASE_SENSITIVE, CASE_INSENSITIVE.
  • values - (Optional) Specific value of the Cost Category.

dimension

  • key - (Optional) Unique name of the Cost Category.
  • matchOptions - (Optional) Match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for MatchOptions is equals and CASE_SENSITIVE. Valid values are: equals, absent, STARTS_WITH, ENDS_WITH, contains, CASE_SENSITIVE, CASE_INSENSITIVE.
  • values - (Optional) Specific value of the Cost Category.

tags

  • key - (Optional) Key for the tag.
  • matchOptions - (Optional) Match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for MatchOptions is equals and CASE_SENSITIVE. Valid values are: equals, absent, STARTS_WITH, ENDS_WITH, contains, CASE_SENSITIVE, CASE_INSENSITIVE.
  • values - (Optional) Specific value of the Cost Category.

splitChargeRule

  • method - (Required) Method that's used to define how to split your source costs across your targets. Valid values are fixed, proportional, even
  • parameter - (Optional) Configuration block for the parameters for a split charge method. This is only required for the fixed method. See below.
  • source - (Required) Cost Category value that you want to split.
  • targets - (Required) Cost Category values that you want to split costs across. These values can't be used as a source in other split charge rules.

parameter

  • type - (Optional) Parameter type.
  • values - (Optional) Parameter values.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - ARN of the cost category.
  • effectiveEnd - Effective end data of your Cost Category.
  • id - Unique ID of the cost category.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

awsCeCostCategory can be imported using the id, e.g.

$ terraform import aws_ce_cost_category.example costCategoryARN