Description
You can configure an automatic allocation rule to automatically allocate instances that meet specified conditions to the specified cost center. This eliminates the strenuous and time-consuming process of manual allocation. This topic describes how to configure an automatic allocation rule.
Procedure
Automatic allocation rule
Create a rule
Log on to the User Center console. In the left-side navigation pane, choose Cost Allocation > Cost Center. On the left side of the Cost Centers page, click the name of a cost center. On the Automatic Allocation Rule tab, click Create Rule.

Add conditions. Click the Add Condition icon and configure a condition as prompted.
Add condition groups. Click the Add Condition Group icon and configure a condition group as prompted. You can configure multiple conditions for the condition group. You can specify logical operators, such as AND and OR, to connect the conditions.

Dimensions. You can configure a condition for an automatic allocation rule based on the following dimensions:
Account: Select Account from the Condition drop-down list. Specify a linked account whose resources you want to allocate to the cost center.
Product: Select Product from the Condition drop-down list. Specify a service whose resources you want to allocate to the cost center.
Product Details: Select Product Details from the Condition drop-down list. The resources that match the specified details of a service are allocated to the cost center.
Resource Group: Select Resource Group from the Condition drop-down list. Specify a resource group whose resources you want to allocate to the cost center.
Tag: Select Tag from the Condition drop-down list. The resources that match the specified key-value information are allocated to the cost center.
Name: Select Name from the Condition drop-down list. The instances that match the specified name are allocated to the cost center. If the length of the specified name exceeds 18 characters, the excess characters are truncated.
Important
You can configure conditions on multiple dimensions or multiple conditions on the same dimension.
If you log on to the Billing Management console with a main financial account, you can view the information about the main financial account and the linked accounts. If a linked account is disassociated from the main financial account, the corresponding conditions are disabled. The resources of the linked account are no longer visible and the costs of the linked account are no longer calculated.
The system allocates instances whose tag, resource group, and name match the specified conditions.
After you configure conditions and condition groups, click Submit.
Effective scope
Log on to the User Center console. In the left-side navigation pane, choose Cost Allocation > Cost Center. On the Cost Centers page, turn on Automatic allocation rules apply to all resources. This improves efficiency when the system uses an automatic allocation rule to allocate instances to cost centers.

After you turn on the preceding switch, the automatic allocation rules of all cost centers take effect for all resources, including new resources, unallocated resources, and resources allocated by using an automatic allocation rule.
Note
This setting does not take effect for resources that you manually allocated to cost centers. You can remove the allocated resources from cost centers. After the status of the resources changes to Unallocated, the resources can be allocated by using an automatic allocation rule.
Important
You can create only one automatic allocation rule for a cost center.
You can configure a maximum of 10 conditions for an automatic allocation rule.
After you configure an automatic allocation rule for a cost center, the matched instances are allocated to the cost center the day after the automatic allocation rule is configured. You can view the allocation result on the Billing Details tab.
If an instance matches multiple automatic allocation rules, the automatic allocation rule of the first cost center in the Cost Center tree takes precedence. After the automatic allocation rule is executed for the instance, the subsequent rules no longer take effect.
After an instance is automatically allocated to a cost center, you can remove the instance from the cost center and re-allocate the instance to another cost center. You can also transfer the instance from the current cost center to another cost center. For more information, see Allocate resources.
Automatic allocation rules do not take effect for instances that are manually allocated to cost centers. On the Cost Centers page, you can check whether an instance is automatically or manually allocated in the Source column.
For more information, see Cost Unit.
Allocate attached resources
Log on to the User Center console. In the left-side navigation pane, choose Cost Allocation > Cost Center. On the Cost Centers page, click Edit Rule under Associated ECS resources are allocated or transferred. to configure a rule for allocating attached resources with ECS instances.

In the dialog box that appears, specify one or more types of attached resources that you want to automatically allocate together with ECS instances.

Important
You can allocate attached resources linked with instances. If you allocate an instance to a cost center, the attached resources of this instance are allocated to the same cost center.
Manual allocation takes precedence over attached-resource allocation. Attached-resource allocation takes precedence over automatic allocation.
If you configure an attached-resource allocation rule for a specific type of resources, you cannot manually allocate the resources.