Rule Engine

The Rule Engine helps automate cloud cost governance across your environments. It allows you to define rules that take actions on cloud resources based on conditions, reducing the need for manual effort.

This feature is useful for teams managing multi-account and multi-cloud environments where consistent cost control and governance are required. Rule Engine works as a policy driven system where conditions trigger actions automatically.

Why do you need Rule Engine?

Managing cloud costs manualy does not scale. As infrastructure grows, issues with tagging, ownership, and cost allocation become more common.

Rule Engine helps by:

Without automation, teams spend more time fixing data than analyzing it.

Benefits of Rule Engine

Rule Engine provides the following benefits:

How Rule Engine helps in cloud cost management?

Rule Engine maintains clean and structured cost data in the background.

It helps you:

This improves reporting accuracy, enhances cloud cost visibility, and ensures accurate cost allocation through consistent tagging automation.

Use case

A common real time scenario is in a company managing multiple cloud accounts where resources are frequently created without proper tagging. This leads to unclear ownership and inaccurate cost allocation. 
With Rule Engine, the team sets up a rule to automatically identify resources that do not have a cost center tag and apply a default value based on predefined logic. The rule is configured to run automatically after each cost data parsing cycle. 
As new resources are added, the rule ensures they are immediately tagged without manual intervention. Over time, this improves cloud cost visibility, ensures accurate cost allocation across teams, and reduces the effort spent on fixing inconsistent data, allowing teams to focus more on cost optimization and analysis.

Key components of Rule Engine

Rules

Rules define what action should happen and when. Each rule includes a condition and an action. This approach supports rule based cost management by enabling automated tagging and consistent governance across resources.
For example, you can identify resources without a cost center or owner tag and apply user defined tags automatically. This ensures proper cost allocation.

Rules can be triggered:

To manage rules:

Rules tab

A common example is tagging all untagged resources in an account with a default cost center like Engineering or SharedServices. Another example is updating tags based on naming patterns, such as assigning a cost center based on resource prefixes or account level mapping. These actions help maintain clean and consistent cost data without manual intervention.

Execution History

Execution History shows how and when each rule was executed. It gives you visibility into the lifecycle of a rule run and helps you understand what actually happened.

Each execution goes through a status:

Execution History tab

Execution History also shows how the rule was triggered:

When you open a specific execution entry, you can view the list of resources where the rule was applied. This is available only for executions with a Completed status. It helps you verify exactly which resources were updated and ensures that the rule worked as expected. 

For example, if you run a rule to assign a cost center to untagged resources, you can check the execution history to confirm which resources were updated and validate that the correct cost center was applied. 

Configuring a Rule

Setting up a rule in CloudSpend is a step by step process. Each step helps you define what the rule does, when it runs, and how it applies governance actions.

To configure rule,

  1. Navigate to Admin > General > Rule Engine.
  2. Click Add Rule and follow the steps below.

Step 1: General Information

In this step, you define the basic details of the rule.

  1. Display Name: Enter a clear and meaningful name for the rule. This helps you identify the rule later in the Rules list and Execution History.
  2. Description: Provide a short explanation of what the rule does. This is useful for teams managing multiple rules. Example: Assign default cost center to resources without tags after parsing.
  3. Run After Every Parsing: Choose whether the rule should run automatically after each cost data parsing cycle. Select Yes if you want the rule to be applied continuously as new data is ingested. Select No if you want to run the rule manually only when needed. For instance, if enabled, every time new billing data is processed, the rule will automatically check for untagged resources and assign a cost center.

Configure rule step one

Once you complete this step, click Next to proceed.

Step 2: Define Criteria

In this step, you define which resources the rule should apply to. This is done by selecting a report type and building conditions using filters.

  1. Select any one of the below options as Report Type:
    1. Accounts: Apply the rule to resources within a specific cloud account.
    2. Cost Centers: Apply the rule to resources grouped under a specific cost center.
    3. Reports: Apply the rule based on a specific report view, such as service level or category level data.
  2. Choose scope (Accounts / Cost Centers / Reports): Based on the selected report type, choose the specific entity. Select the account, cost center, or report from the dropdown. This defines where the rule will evaluate resources.
  3. Define Criteria: You can chain multiple conditions using AND or OR. Click the add icon + to add another tag condition. Click the delete icon to delete a condition. Additionaly, you can fine-tune or manually edit the logical expression combining conditions.

Configure Rule for Rule Engine

Once the criteria is defined, click Next to proceed to defining actions.

Step 3: Define Actions

In this step, you define what action should be performed when the specified criteria are met.

  1. Select the Action Type. When the rule runs, it first evaluates the criteria defined in Step 2 to identify matching resources. It then applies the selected tags only to those resources. If a tag with the same key already exists, the rule can update its value based on the configuration. For example, if a resource does not have a cost center, the rule can assign cost_center:shared services. If the tag is already present, its value can be updated to ensure consistency across resources.
    Note: Currently, only tag-based actions are supported.
  2. Tags: This allows you to add or update user defined tags on the resources that match the criteria.
  3. Configure tag values: After selecting Tags, choose the key value pairs that should be applied. Select one or more tag keys and their corresponding values. You can apply multiple tags as part of the same rule. Example: cost_center: engineering, environment: production.
  4. After configuring the action, you have two options:
    1. Save and Run: Saves the rule and immediately executes it. This is useful when you want to apply changes right away.
    2. Save: Saves the rule without executing it. You can run it later manually or allow it to run automatically based on your configuration.

Rule Configuration

Once saved, the rule becomes active and will be listed in the Rules section. Its execution details can be tracked in the Execution History tab. Rule Engine enables automated tagging, improves cloud cost visibility, and supports rule based cost management for accurate cost allocation across your cloud environments.

Top