# Billing Rulesets

> Apply markups, discounts, flat fees, and custom calculations

---

Site [llms.txt](/llms.txt)

---

Billing Rulesets allow you to define rules to adjust cloud costs before presenting them to your customers.

Rules can optionally include filters to target specific services, regions, or resources. Each ruleset is scoped to one cloud provider (or all providers) and assigned to one or more customers.

<div class="alert alert-info" role="alert">


Rulesets are applied by the data pipeline, not on demand: changes take effect on the next pipeline run. Adjusted costs appear as the **Rerated Cost** metric in cost views and are the basis of Summary Reports.
</div>


## Key concepts

- **Ruleset:** A named container holding one or more rules, a validity period, a cloud-provider scope, and customer assignments.
- **Standard rule:** A pre-built rule template (for example, margin, discount, or flat fee) that transforms costs.
- **Custom metric:** A derived cost calculation, defined once in the shared [Custom Metrics](/docs/cbp/navigating-the-platform/settings/custom-metrics/) library and assigned to rulesets.
- **Source metric:** The cost figure the ruleset operates on: Billed Cost, Effective Cost, List Cost, Contracted Cost, or a custom metric. The rules transform that number.
- **Filter:** A condition restricting which cost lines a rule applies to.
- **Period:** The date range during which a ruleset is active.
- **Assignment:** Customers to whom a ruleset is applied. A customer can have only one billing ruleset per cloud provider at a time.

## Access Billing Rulesets

- Go to **Settings** > **Billing Rulesets** in the sidebar.

The page groups rulesets into provider tabs (**AWS**, **Microsoft**, **Google Cloud**, and **All Providers**), each showing a count. The table displays each ruleset's name, cloud provider, assignments, start and end dates, and rule count.

From here, you can [create a new ruleset](#create-a-ruleset) or select one to view, update, or delete it. A ruleset that is still assigned to customers cannot be deleted until its assignments are removed.

## Create a ruleset

Select **Create Ruleset** to open the creation form, which includes the **Settings**, **Custom Metrics**, and **Rules** sections.

### Settings

- **Rule Set Name:** Required. A descriptive name for the ruleset.
- **Description:** Optional notes about the ruleset.
- **Customers:** Select the customers the ruleset applies to.
- **Start Date:** Required. The month this ruleset begins applying.
- **End Date:** The month the ruleset stops applying. Leave empty for a ruleset with no expiration date.
- **Cloud Provider:** Limits the ruleset to one cloud, or select **All Providers** to apply to every cloud. An All-Providers ruleset cannot coexist with provider-specific rulesets on the same customer. The provider is fixed after creation. To change scope, create a new ruleset and remove the old one.

### Custom Metrics

Optionally select **Assign Custom Metric** to attach reusable metrics from the shared library. Definitions are managed centrally in [Settings > Custom Metrics](/docs/cbp/navigating-the-platform/settings/custom-metrics/) and are read-only here: edits made in the library flow into every ruleset that references them on the next pipeline run.

### Rules

First choose the **Source Metric**, the base cost figure the rules operate on (for example, Billed Cost or Effective Cost, or a custom metric). Then add one or more rules from the available rule types. Rules are evaluated top to bottom; drag and drop to reorder. Percentage rules can optionally include [filter conditions](#filter-conditions) to limit the cost lines they apply to.

## Rule types

For any value-bearing rule, choose **Fixed Value** to enter the number directly or **Custom Variable** to reference a [custom variable](#custom-variables) so different customers can have different rates.

### Margin

Applies a percentage markup to costs.

**Example:** Add 20% margin to all costs.

### Discount

Applies a percentage discount to costs (up to 100%).

**Example:** Apply a 15% volume discount for a specific customer.

### Tiered margin

Applies volume-based markups using thresholds. Configure the aggregation: the **Aggregation Metric** (the metric being adjusted), the **Tier Metric** (the metric summed to determine the tier), an optional **Group By**, and an **Aggregation Function**. Then define tiers, each with a **Min Threshold**, **Max Threshold**, and **Percentage**.

**Example:** 10% markup on the first $1,000, 15% on $1,000–$5,000, 20% above $5,000.

### Tiered discount

Applies volume-based discounts using the same tier configuration as Tiered margin.

### Flat fee

Adds a fixed monthly charge.

**Example:** Add a $100/month support fee.

### Flat discount

Applies a fixed monthly discount.

**Example:** Apply a $200/month loyalty discount.

### Custom line item

Adds a standalone billing line item. Enter an amount and the **Billing Period** it applies to (for example, `monthly`).

**Example:** Add a $500 one-time setup fee.

<div class="alert alert-info" role="alert">


Flat fee, flat discount, and custom line item rules apply as fixed amounts: they are grouped by billing period and provider and do not take filter conditions.
</div>


## Filter conditions

Percentage-based rules can include filter conditions that restrict which cost lines they apply to. On rule cards, filters are summarized as **Applies to spend where**.

Each filter condition has three parts:

- **Field:** The billing column to match (for example, Service, Region, or Resource ID).
- **Operator:** Comparison method: equals, not equals, greater than, greater than or equal to, less than, less than or equal to, contains, not contains, or regex.
- **Value:** A literal value, or a reference to another billing column. The contains, not contains, and regex operators take literal text only.

Combine multiple conditions with **AND** (all must match) or **OR** (any must match).

### Examples

- `Service = ec2 AND Region = us-east-1`: Only apply to EC2 costs in us-east-1.
- `Service = rds OR Service = redshift`: Apply to RDS or Redshift costs.

## Custom variables

Custom variables are reusable placeholders that can be referenced in rules and custom metric formulas instead of hardcoded values, making rulesets reusable: the same ruleset structure can produce different results for different customers by changing the variable values. Variables are defined per customer on the organization's **Custom Variables** tab.

**Example:** Instead of hardcoding a 15% discount, reference a variable called `customer_discount_rate` to set a different value for each customer.

## Assignments

A ruleset takes effect when assigned to a customer. Assign customers from the ruleset's **Customers** field, or from the organization's side under **Settings** > **Organizations** > **Billing** tab (**Assign Billing Ruleset** / detach). See [Organizations](/docs/cbp/navigating-the-platform/settings/organizations/).

A customer can have only **one billing ruleset per cloud provider** for a given period, and an All-Providers ruleset cannot coexist with any provider-specific ruleset on the same customer. Conflicting assignments are blocked with a message identifying the existing ruleset to detach first.

## Ruleset detail

Select any ruleset to view full details:

- **Overview:** Name, type, cloud provider, assigned customers, description, rule and custom-metric and custom-variable counts, active period, and timestamps.
- **Custom Metrics:** Each assigned metric, in execution order.
- **Rules:** The source metric, and each rule's name, type, value, and filter summary, in execution order.

Use **Edit** to modify the ruleset, or **Delete** to remove it. Delete is unavailable while the ruleset is assigned; remove assignments first.

## Execution order

Rules in a ruleset and custom metrics are evaluated from top to bottom in the order they appear, so earlier rules can affect the values later rules operate on. Arrange your rules accordingly.
