Shared services such as CDN, Object Storage Service (OSS), and Internet Shared Bandwidth allocate costs below the instance level—by domain name, bucket, or elastic IP address (EIP). Use tags to allocate costs for these services.
Step 1: Add a tag to resources
Add a tag to a resource by using one of the following methods:
-
Console: Add tags on the Tag page of the Resource Management console or in individual service consoles.
-
Use an API operation: You can call the TagResources operation of the Tag service or the related operation of an Alibaba Cloud service to add a tag to a resource.
-
For more information about the TagResources operation of the Tag service, see TagResources.
-
For more information about the related operation of an Alibaba Cloud service, see the documentation of the Alibaba Cloud service.
-
-
Use CloudOps Orchestration Service (OOS): You can use OOS to add tags to multiple resources at a time. For more information, see Use OOS to add tags to multiple ECS instances at a time.
In this example, create and add the tag Project:Entertainment to OSS buckets to identify entertainment project resources.
-
Log on to the OSS console.
-
In the navigation pane on the left, click Buckets.
-
Hover over the tag icon for the target bucket and click Edit.
-
On the Bucket Tagging page, click Create Tag.
-
Enter a tag key (for example,
Project) and a tag value (for example,Entertainment), and then click Save. -
View the tag that is added to the bucket.
The tag filter area above the bucket list shows the applied tag, such as
Project: Entertainment. Only matching buckets are displayed. Click Edit next to the tag to modify it.
Step 2: Enable the cost allocation tag
Tags appear on the Split Bill and Cost Center pages in the Expenses and Costs console only after you enable them as cost allocation tags. In this example, enable the tag key Project.
-
Go to the Cost Allocation Tags page in Expenses and Costs. If you have not activated this feature, follow the on-screen instructions to activate it.
-
On the Cost Allocation Tag page, select the tag and enable it.
ImportantA new tag appears on the cost allocation tag list one day after it is created.
Step 3: Create an automatic cost center allocation rule
On the Cost Center page in Expenses and Costs, create an automatic rule to allocate resources to cost centers based on tags.
-
Go to the Cost Center page in Expenses and Costs. If you have not activated the cost center feature, follow the on-screen instructions to activate it.
-
On the Cost Center page, click + in the cost center tree on the left to create a cost center.
-
If no rules exist in the cost center, click Create Rule. Otherwise, click Edit to modify an existing rule.
-
Configure an automatic allocation rule based on the cost allocation tag.
-
Condition: Select Tag.
-
Select the tag key. In this example, select
Project. -
Select the tag value. In this example, select
Entertainment.
-
-
View the automatically allocated resources.
ImportantAutomatically allocated resources appear in the cost center one day after the rule is created.