Tagging#

Allocation rules are only as good as the tags they read. On the Tagging page AI drafts one tagging convention for your whole estate, Reply CMP checks every resource against it, and the corrected tags are written back to your clouds, where allocation and every other tool read them.

Navigate: left navigation → FinOps → Allocate → Tagging in the page header.

Tagging covers the resources that Discovery fully supports, shown as Supported in Discovery. Cost-only resources are left out of the convention, its figures and the tags written back.

Reading the page requires FinOps.Allocation / Read. Generating, saving and deleting the convention, and writing tags to the clouds, require FinOps.Allocation / Write.


How it works#

A convention defines canonical keys (for example environment, cost-center, owner). For every resource and canonical key, Reply CMP resolves one value in this order:

  1. Tag: the canonical key or one of the keys listed under Also written as, in that order. The tag value is mapped to an allowed value, or to one of the other ways that value is written.

  2. Rules: tried in order when no tag gives a value. A rule reads the resource name, the container (Azure resource group, AWS account ID or GCP project ID), the connection name, the resource type or the region.

  3. Values in names: for a key with allowed values, each allowed value and its other spellings are searched as whole words in the names you choose, in order: dev is found in rg-dev-01 and api-dev2, not in devops.

  4. Default value: used when nothing else applies.

Keys and values are compared ignoring case, spaces and separators: Env, ENV and env_ are one key, Prod and PROD one value. Anything else, such as prd for production, is listed explicitly in the convention.

A tag whose value is not allowed, or is a placeholder such as tbd or N/A, stays Not allowed and is not compliant. A resource without a tag, a matching rule and a default is Missing.

Note

Saving a convention changes nothing in your clouds. Allocation keeps reading the cloud tags, so it follows the convention when the tags are written back (see Fix tags at source).


Generate the convention#

The first time you open the page, click Generate convention. In about 10 to 20 seconds AI reads your tag keys and values and a sample of your resource group, account, project, connection and resource names, and drafts:

  • one canonical key for every dimension, with the other spellings found in your tags, in any language;

  • allowed values with the ways each is written, including abbreviations and evident typos; placeholders such as N/A or tbd are never allowed;

  • rules that find the value of untagged resources from their names;

  • the keys that should be required.

The draft opens in the Convention tab with the notes of the AI at the top. Nothing is saved until you click Save. If the draft cannot be generated, the page says so: try again in a few minutes or use or define it manually.

Regenerate drafts a new convention from the current tags at any time, for example after new keys appeared.


Review the convention#

In the Convention tab each key is a card; expand it to edit:

Field

Meaning

Canonical key, Description, Required

Required keys make the tagging score.

Also written as

Other keys read as this one, in order.

Allowed values

The values the key can have and the other ways each is written. Leave empty for free text such as owners or cost center codes: any value is accepted except placeholders such as tbd, N/A, unknown or -.

Values in names

Only for keys with allowed values. Turn on Find the values in names and choose where to look: resource group, account or project, then resource name, then connection name. No pattern to write: a spelling added to an allowed value is found in names too. Search the connection name only for connections of a single environment, because every resource of the connection gets its value.

More rules (Rules for untagged resources for keys without allowed values)

Conditions on names that give a value, for what the names do not say, such as one AWS account per environment. A matches regex rule can use a captured group as value ($1, $2…); with any other condition $1 is plain text.

Default value

Used when neither a tag nor a rule gives a value.

Still without a value

Where the resources that are still Missing live (resource group, account, project or connection), the most expensive first. Assign a value to a place and a rule is added for it.

Under each rule and each name searched, the editor shows how many resources take their value from it, with examples, or warns when none does. The figures follow the draft while you edit.

Trust names over tags decides what happens when a tag contradicts the name of the resource, its resource group, account or project (for example a tag left behind after a promotion). Off, the tag wins; on, the value from the name is used. Either way the resource is listed as likely outdated.

While you edit, the Compliance tab shows the effect of the draft, marked Draft preview. Save stores the convention; ⋯ → Discard unsaved changes goes back to the saved one.


Check compliance#

The Compliance tab shows how well your estate follows the convention:

Indicator

Meaning

Score

Share of the last 30 days’ cost with a valid value for every required key (all keys when none is required).

Compliant resources

Active supported resources with a valid value for every required key.

Values to review

Required keys without a value or with a value that is not allowed.

Likely outdated tags

Tags that disagree with the resource group, account, project or name.

Tags to fix at source

Values of the convention that differ from the cloud tags.

Below, each key shows where its values come from (correct tag, normalized, from names, default, not allowed, missing), its coverage by resources and cost, and what to review. Expand a key to:

  • click a status to list its resources;

  • accept a value that is not allowed as another way to write the suggested value (→ value), then save;

  • see the likely outdated tags.

The saved convention is evaluated again every day and after a discovery you start, so new resources are covered without any action.


Fix tags at source#

The Fix at source tab lists every resource whose cloud tags differ from the convention, with the change to make (Env=prd → environment=production). Filter by key or search by resource name.

  • Click the upload icon on a row to write one resource.

  • Select rows and click Write selected (up to 1000 resources).

  • Click Write all to write every resource matching the filters on read-write connections.

The tags are written by a background job, in batches of 100 resources. You can leave the page while it runs: the progress is shown when you come back, and you get a notification when it ends. Stop ends the job after the current batch. One job per tenant runs at a time; while it runs, the write buttons are disabled.

A confirmation lists what happens before anything is written. Existing tags are never touched, except the ones the convention replaces: with Remove replaced keys on, an old key replaced by a canonical key (Env when environment is written) is deleted; off, it is kept. If Azure or AWS writes the new tags but refuses to delete the old key, the resource counts as written and the result says why the old key stays.

When the job ends, the result shows how many resources were written, skipped or failed, with the reason for each one not written (the first 500; the others stay in the list). Written resources leave Fix at source at once. Reply CMP then runs a discovery of each connection it wrote on to read the tags back from the cloud; when that discovery ends, compliance and the allocation groups are updated with them. If a discovery is already running on a connection, the tags written there appear after its next discovery. Every batch is recorded in the audit log.

Provider

Resources

Notes

Azure

Every resource that supports tags

Tag keys are case-insensitive: writing environment over Environment updates the existing tag. At most 50 tags per resource (15 on Automation, CDN, DNS zones and records). Storage accounts accept keys up to 128 characters; DNS zones, Traffic Manager and Front Door accept fewer characters in keys.

AWS

Resources supported by the Resource Groups Tagging API

Keys starting with aws: cannot be written. At most 50 tags per resource. Resources of global services (CloudFront, Route 53) are written through us-east-1, S3 buckets in their own region.

GCP

Compute Engine instances, disks, images and snapshots; Cloud Storage buckets

Labels are written in lowercase. At most 64 labels per resource. A resource whose values are not valid labels (for example e-mail addresses) is skipped.

A resource is skipped, with the reason, when:

  • its connection is read-only;

  • the provider does not let anyone tag it: classic Azure resources, the master database of Azure SQL, AWS managed KMS keys, CloudWatch dashboards, GCP resource types other than the ones above;

  • writing its tags would change more than its tags: Azure IP groups and firewall policies (tags change only with the resource update), resources in a managed resource group such as Databricks, CloudFormation stacks (tagging a stack updates the stack and every resource in it);

  • a value breaks the provider’s tag rules;

  • it no longer exists in the cloud: it leaves the list after the next discovery.

A resource fails when something on the customer side blocks the write: a missing permission, a read-only lock, an Azure Policy that denies the change, a KMS key policy that does not allow tagging, or a resource that already has the maximum number of tags. The reason says which, and the resource stays in the list.

Note

Resources deployed with infrastructure as code (Terraform, Bicep, CloudFormation) get the tags of their template back at the next deployment. Write the convention’s values in the templates too, or the next deployment undoes the write.

Important

Writing tags requires a read-write connection (Tenant → Connections) whose credentials can change tags: Azure Tag Contributor; AWS tag:TagResources, tag:UntagResources and the tagging permissions of each service; GCP compute.instances.setLabels, compute.disks.setLabels, compute.images.setLabels, compute.snapshots.setLabels and storage.buckets.update.

Read-only connections#

For resources on read-only connections, or to apply the changes with your own tooling, click Export:

Format

Content

CSV, every cloud

Resource ID, key, value, where the value comes from and the current tag

Azure CLI script

az tag update --operation Merge commands

AWS CLI script

aws resourcegroupstaggingapi tag-resources commands

Review the files before running them with credentials that can write tags. Values that are not allowed are never exported or written.


Using the CMP Agent#

Ask the CMP Agent questions such as “How good is our tagging?” or “Which tags are outdated?”. It reads the convention and its last evaluation; without a convention it summarizes the tags in your clouds.

Writing tags back does not create allocation groups. After Fix at source, select Update groups on the Allocate page: the Agent creates the missing environment and project groups for the values of the convention, adds the matching rule to the existing ones and sets a budget from last month’s cost where there is none, with your confirmation.