# Tag Mapping

Tag mapping rules allow you to transform and enrich your cloud billing data before it's ingested into Cloud Ctrl. These rules can add, modify, copy, or remove tags, as well as apply cost markups to specific line items based on configurable conditions.

# Overview

Tag mapping rules are defined in your Cloud Ctrl tenancy and are processed during each data import. Rules are executed in order, and you can create as many rules as needed to handle your data transformation requirements.

TIP

Tag mapping rules only apply to data imported after the rules are created. If you need tag mapping rules to apply to your full historical data, please contact support to arrange a reload of your historical data.

# How Tag Mapping Works

Tag mapping rules are applied during the import and transformation process, before data is ingested into the platform. This means:

  • Rules are evaluated against each line item during import
  • Only data imported after rule creation will have the rules applied
  • Historical data (older than the last 2 months) will not have rules applied unless you request a historical data reload from support

# Rule Structure

Each tag mapping rule consists of:

  1. Conditions - Criteria that must be met for the rule to apply
  2. Actions - Operations performed when conditions are met
  3. Order - The sequence in which rules are evaluated

# Conditions

Conditions define when a rule should be applied. You can use multiple condition types:

# Available Condition Types

  • Tag Key Value Match - Matches when a tag key has a specific value (e.g., Tag Key "CostCenter" equals "Engineering")
  • Source Field Match - Matches when fields like Service Name, Product Name, or Unit match a pattern (e.g., Service Name matches "prd-*")
  • Subscription Name Match - Matches when the subscription name matches a specified value or pattern
  • Cloud Account Name Match - Matches when the cloud account name matches a specified value or pattern

Each condition type has both case-sensitive and case-insensitive versions available.

# Condition Logic

  • Multiple conditions are combined with AND logic - all conditions must match for the rule to apply
  • Multiple values within the same condition type are combined with OR logic - if you specify multiple tag key values, the rule applies if any of them match

Example: If you have two conditions:

  • Tag Key "CostCenter" matches "Engineering" OR "IT"
  • Subscription Name matches "Production"

The rule will apply when:

  • (Tag Key "CostCenter" equals "Engineering" OR "IT") AND (Subscription Name equals "Production")

# Actions

When a rule's conditions are met, one or more actions are executed:

# Add Tag Key/Value

Adds or overwrites a tag key with a specified value. If the tag key already exists, its value will be replaced. If the tag key doesn't exist, it will be added.

# Copy Value

Copies the value from a source tag key to a target tag key. The target key's value will be overwritten with the source key's value.

Example: Copy Value from "Department" to "CostCenter" - if a line item has Department="Engineering", it will also have CostCenter="Engineering".

# Remove Tag

Deletes a tag key and its value from the line item before it's ingested into the platform.

# Markup Cost

Applies a percentage markup to the cost of the line item. The markup is calculated and applied during the transformation process.

# Rule Processing

# Stop Processing

Each rule has an optional setting: "Stop applying other mapping rules if conditions met". When enabled:

  • If the rule's conditions are met, the actions are executed
  • No further rules in the sequence will be evaluated for that line item
  • This is useful for creating exclusive rules or preventing multiple rules from modifying the same data

# Rule Order

Rules are processed in the order they appear in your rule list. The order matters because:

  • Earlier rules are evaluated first
  • Actions from earlier rules can affect the data that later rules evaluate
  • You can reorder rules to control the sequence of transformations

# Managing Rules

Tag mapping rules can be:

  • Added - Create new rules to handle additional transformation scenarios
  • Edited - Modify existing rules to update conditions or actions
  • Removed - Delete rules that are no longer needed
  • Reordered - Change the sequence in which rules are evaluated

TIP

Changes to tag mapping rules (additions, edits, removals, or reordering) will only take effect on the next data import. Existing data that has already been ingested will not be affected.

# Best Practices

  1. Order matters - Place more specific rules before general ones
  2. Use "Stop processing" - Enable this option for exclusive rules to prevent unintended interactions
  3. Test incrementally - Add rules one at a time and verify results before adding more
  4. Document your rules - Use descriptive names and comments to explain the purpose of each rule
  5. Plan for historical data - If you need rules applied to historical data, contact support before creating rules to arrange a historical reload