Help Center/ Config/ User Guide/ Resource Compliance/ Built-In Policies/ General Policies/ Resource Names Meet Regular Expression Requirements
Updated on 2025-08-25 GMT+08:00

Resource Names Meet Regular Expression Requirements

Rule Details

Table 1 Rule details

Parameter

Description

Rule Name

regular-matching-of-names

Identifier

Resource Names Meet Regular Expression Requirements

Description

If a resource name that does not comply with regular expression requirements, this resource name is non-compliant.

Tag

name

Trigger Type

Configuration change

Filter Type

All resources

Rule Parameters

regularExpression: indicates the regular expression to be matched. % indicates any characters, and _ indicates a character.

Application Scenarios

After a company migrates to the cloud, the number of resources created on the cloud keeps increasing. Some large enterprises may have hundreds of thousands or millions of resources. They need to standardized resource naming for effective resource governance.

Huawei Cloud recommends that you formulate unified resource naming rules to categorize resources by cloud service type and resource tag. For example:

  • All IAM user names must start with hw_user_.
  • All ECSs that are tagged by prod must have "Do-Not-Delete" in their names.

Solution

Name resources in compliance with a convention to facilitate routine resource management.

Rule Logic

  • If the name of a resource does not match the naming convention represented by the specified regular expression, the resource is non-compliant.
  • If the name of a resource matches the naming convention represented by the specified regular expression, the resource is compliant.