Updated on 2025-08-25 GMT+08:00

Tag Prefixes and Suffixes Check

Rule Details

Table 1 Rule details

Parameter

Description

Rule Name

resource-tag-key-prefix-suffix

Identifier

Tag Prefixes and Suffixes Check

Description

If a resource does not have any tags that can be matched by a specified prefix or suffix, this resource is not compliant.

Tag

tag

Trigger Type

Configuration change

Filter Type

Supported Services and Resources

Rule Parameters

  • tagKeyPrefix: Indicates a tag key prefix. An empty string indicates that all tag key prefixes are allowed.
  • tagKeySuffix: Indicates a tag key suffix. An empty string indicates that all tag key suffixes are allowed.

Application Scenarios

After a company migrates to the cloud, as their cloud resources keep growing, they usually need to manage hundreds of thousands or millions of resources within one account. Manually classifying these resources is difficult and inefficient. To meet this challenge head on, you will need a cloud service to manage resources automatically.

Tag Management Service (TMS) enables you to classify and group resources with tags. You can tag resources by their attributes, such as by department, region, or project. For details, see Principles for Naming Tags.

Solution

Add one or more tags to a single cloud resource or to multiple cloud resources at a time on the TMS console. For details, see Adding Resource Tags.

Rule Logic

  • If tagKeyPrefix is empty, any tag key will be matched by the prefix.
  • If tagKeySuffix is empty, any tag key will be matched by the suffix.
  • If both prefix and suffix of a resource tag key match the specified ones respectively, the tag key is matched.
  • If any tag key of a resource is matched, the resource is compliant.
  • If no tag key of a resource is matched, the resource is non-compliant.