Working With Rule-Based Dimensions

You can work with rule-based dimensions on the Rule-Based Dimensions page (Administration > Cloud Settings > Rule-Based Dimensions).

Rule-based dimensions are populated according to rules you define. You can use these dimensions to look at your costs from new, meaningful perspectives.

A common use case is to create several dimensions like Department or Environment, populated based on known account values. You might define a Department rule-based dimension with a rule for each known account. For instance, a rule might express: "If the account is 'aws-123', then use the value 'Finance'". In that way, all the "aws-123" costs will be classified as being in the "Finance" department.

You create a rule-based dimension by adding one or more rules to a rules list. For more information on rules and rules lists, see below. For instructions on how to create a rule-based dimension, see Creating Rule-Based Dimensions.

Rules lists

A rules list contains rules that determine how the rule-based dimension is populated. You can define multiple rules in a list. The rules are evaluated in the order they are listed.

You can create several rules lists for a rule-based dimension, but only one list can apply at a time. For example, you could define a new rules list for each calendar month. A rules list remains in effect until the effective date of the next list.

For example, a rules list might take effect in January 2022-01. Those rules remain in effect from that month forward, until another rules list is defined for a subsequent month. You might then add a rules list effective April 2023 and those rules would then be used for that month forward.

Rules

A rule consists of a condition and a value and is added to the rules list of a rule-based dimension. The condition is matched against your bill data and if it is evaluated to be true, the value will be assigned to the rule-based dimension.

Conditions are described in detail in the following sections.
The value is a static text value.

Example:

Condition: The vendor account is AWS
Value: “Finance”

Resulting rule: If the bill data contains a vendor account named AWS, assign the value "Finance" to the rule-based dimension.

Rules can be simple, as in the example above, but you can also create more complex rules by combining multiple conditions together into groups. The following sections describe the building blocks of a condition and how to combine them together. Understanding the information in the following sections is a prerequisite for creating adequate rules for your rule-based dimensions.

Conditions

A condition in its simplest form consists of a dimension that is compared against a value using a selected operator. The condition is evaluated to be either true or false.

The dimension must be one of the Supported Dimensions.
The value is a free-text value that is compared against the selected dimension according to the selected operator.
The operator can be one of:
equals: The condition is true if the dimension and the value are identical.
does not equal: The condition is true if the dimension and the value are not identical.
contains: The condition is true if any part of the dimension matches the value.
does not contain: The condition is true if no part of the dimension matches the value.

To make the comparison between the dimension and the value case-insensitive, use the ignore case variants of the operators: equals (ignore case), does not equal (ignore case), contains (ignore case), and does not contain (ignore case). This will ignore the distinction between uppercase and lowercase letters.

Example:

Dimension: Cloud Vendor
Value: “AWS”
Operator: equals

Condition: Cloud Vendor equals “AWS”

Result: The condition is true if there is a cloud vendor named AWS.

Combined conditions

You can also combine multiple conditions into groups using the Boolean operators AND, OR, and NOT, to create more complex rules.

AND: All conditions or groups of conditions in the group must be true for the value to be assigned to the rule-based dimension.
OR: At least one of the conditions or groups of conditions in the group must be true for the value to be assigned to the rule-based dimension.
NOT: Inverts the result of the condition or group inside it.

Example:

Operator: AND
Condition 1: Cloud Vendor equals "AWS”
Condition 2: Service equals "EC2”

Result: The combined condition is true if the Cloud Vendor is AWS and the Service is EC2.

Example:

Operator: OR
Condition 1: Cloud Vendor equals "AWS”
Condition 2: Service equals "EC2”

Result: The combined condition is true if at least one of the following is true:

The Cloud Vendor is AWS, or
The Service is EC2

Example:

Operator: AND
Condition 1: Cloud Vendor equals "AWS”
Condition 2:
Operator: OR
Condition 2.1: Cloud Vendor contains "azure”
Condition 2.2: Tag does not contain "test”

Result: The combined condition is true if the Cloud Vendor is AWS and at least one of the following is true:

The Cloud Vendor contains "azure", or:
The tag is not "test"

Example:

Operator: NOT
Condition: Cloud Vendor equals "AWS”

Result: The condition is true only if the Cloud Vendor is not AWS.

Example:

Operator: NOT
Condition 1: Cloud Vendor equals "AWS”
Condition 2: Tag equals "test”

Result: The combined condition is true if the Cloud Vendor is AWS, and the tag is "test". The NOT operator reverses the result: If the combined condition is true, the final result is false, and vice versa.