All Products
Search
Document Center

Elastic Compute Service:Resource groups

Last Updated:Dec 20, 2023

Resource groups are used to group your resources based on usage, permissions, and regions, so that you can manage the resources in a hierarchical manner for various users and projects. Each resource belongs to a single resource group. The correlation between resources remains unchanged after the resources are added to resource groups.

Group resources by usage

You can add instances created in the production environment to a resource group named Production Environment and instances created in the test environment to a resource group named Test Environment. During testing, we recommend that you perform operations on instances only in the Test Environment resource group to prevent incorrect operations on instances within the production environment. Before you release a service, you can perform operations on instances in the Production Environment resource group to ensure proper service functionality.

  1. Create the following resource groups: Test Environment and Production Environment.

    For more information, see Create a resource group.

  2. Specify the same administrator for the Test Environment and Production Environment resource groups.

    For more information, see Add RAM authorization.

  3. Create instances named TestEnv1 and TestEnv2.

    When you create an instance, select Test Environment from the Resource Group drop-down list in the Advanced Settings(Optional) section.

    For information about how to create an instance, see Create an instance by using the wizard.

  4. Create instances named ProdEnv1 and ProdEnv2.

    When you create an instance, select Production Environment from the Resource Group drop-down list in the Advanced Settings(Optional) section.

    For information about how to create an instance, see Create an instance by using the wizard.

  5. Log on to the ECS console by using the administrator account of the Test Environment resource group and the Production Environment resource group.

  6. In the left-side navigation pane, choose Instances & Images > Instances.

  7. In the upper-left corner of the page, click All Resources.

    You can see both the Test Environment and Production Environment resource groups.

  8. Click Test Environment.

    Only instances that belong to the Test Environment resource group are displayed on the Instances page.

Manage users and their permissions based on resource groups

You can add instances used by departments in your company to different resource groups and specify administrators to manage the instances. In this example, an IT department and a finance department are used.

  1. Create the following resource groups: IT Department and Finance Department.

    For more information, see Create a resource group.

  2. Specify different administrators for the IT Department and Finance Department resource groups.

    For more information, see Add RAM authorization.

  3. Create instances named IT1 and IT2.

    In the Advanced Settings(Optional) section, select IT Department from the Resource Group drop-down list.

    For information about how to create an instance, see Create an instance.

  4. Create instances named Finance1 and Finance2.

    In the Advanced Settings(Optional) section, select Finance Department from the Resource Group drop-down list.

    For information about how to create an instance, see Create an instance.

  5. Log on to the ECS console as the administrator of the IT Department.

  6. In the left-side navigation pane, choose Instances & Images > Instances.

  7. In the upper-left corner of the page, click All Resources.

    Only the IT Department resource group is displayed.

  8. Click IT Department.

    All instances that belong to the IT Department resource group are displayed on the Instances page.

For more information about the scenarios of resource groups, see Use RAM to create and authorize resource groups.

Limits

  • The following resources can be managed in resource groups: instances, disks, images, elastic network interfaces (ENIs), security groups, and SSH key pairs.

  • Resources cannot be transferred between resource groups across accounts.

Usage notes

  • A resource group can contain cloud resources in different regions.

    For example, Resource Group A can contain instances from the China (Beijing) and China (Hangzhou) regions.

  • If resources that belong to different resource groups in the same account reside in the same region, the resources can be correlated with each other.

    For example, an instance in the China (Beijing) region of Resource Group A can be added to a virtual private cloud (VPC) in the China (Beijing) region of Resource Group B.

  • Resource groups inherit global permissions that are granted to corresponding Resource Access Management (RAM) users. If you authorize a RAM user to manage all Alibaba Cloud resources in your Alibaba Cloud account, the RAM user can access all resource groups in your Alibaba Cloud account.