You can group your resources based on usage, permissions, and regions. This achieves hierarchical resource management based on users and projects. Each resource belongs to only one resource group. Resource groups do not affect the association among resources. In E-MapReduce (EMR), you can specify resource groups only for clusters and projects. This topic describes how to specify resource groups for resources and provides related examples.

Background information

Note the following limits on resource groups:
  • You can create and manage a resource group and authorize RAM users to access a resource group only in the Resource Management console. For more information, see What is Resource Management?.
  • In EMR, you can specify resource groups only for clusters and projects. When you create or scale out a cluster or move a cluster across resource groups, all nodes in the cluster are moved to the same resource group as the cluster. The following node resources can be managed in resource groups: Elastic Compute Service (ECS) instances, disks, images, Elastic Network Interfaces (ENIs), security groups, and key pairs.
  • Resources can be moved only across resource groups under the same account.
    Notice If you move a node resource to a different resource group, the resource group of the cluster to which the node belongs remains unchanged. To manage resources and grant permissions in a centralized manner, we recommend that you manage node resources in the same resource group as the cluster.
Note the following points when you use resource groups:
  • A resource group can contain resources in different regions. For example, Resource Group A contains both clusters in China (Hangzhou) and clusters in China (Shanghai).
  • A resource group can contain different types of resources. For example, Resource Group A contains clusters, ECS instances, and projects.
  • Clusters and projects under the same account can be associated across resource groups if they reside in the same region. For example, your account can access both Resource Group A and Resource Group B. Resource Group A contains a project that resides in China (Beijing). Resource Group B contains a cluster that also resides in China (Beijing). In this case, you can run a job of this project in this cluster.
  • RAM users have access to resource groups as authorized. For example, if you authorize a RAM user to manage all Alibaba Cloud resources under your Alibaba Cloud account, all resource groups under your Alibaba Cloud account are accessible to the RAM user.

Specify a resource group

A resource must belong to a resource group. If you do not specify a resource group when you create a resource, the resource is added to a default resource group. This section describes how to specify a resource group when you create a cluster and a project.

Note When you create a resource, you can only specify a resource group to which you have access.
  • Specify a resource group during cluster creation:
    1. Log on to the Alibaba Cloud E-MapReduce console.
    2. In the top navigation bar, select the region where you want to create a cluster.
    3. Click the Cluster Management tab. Then, click Cluster Wizard in the upper-right corner of the tab.
    4. In the Advance Settings section of the Basic Settings step, select a resource group from the Select Resource Group drop-down list.

      If you want to create a new resource group, click the link below the Select Resource Group drop-down list. For more information, see Create a resource group.

      Note For more information about how to create a cluster, see Create a cluster.
  • Specify a resource group during project creation:
    1. Log on to the Alibaba Cloud E-MapReduce console.
    2. In the top navigation bar, select the region where you want to create a project.
    3. Click the Data Platform tab.
    4. Click Create Project in the upper-right corner of the tab.
    5. In the Create Project dialog box, specify Project Name and Project Description and select a resource group from the Select Resource Group drop-down list.

      If you want to create a new resource group, click the link below the Select Resource Group drop-down list. For more information, see Create a resource group.

      Note If you need to create a cluster to associate it with the project, see Create a cluster.
    6. Click Create.

      For more information about how to create a project, see Manage projects.

Scenarios

Resource groups can be used in the following scenarios:
Note RAM users can view resources as authorized. A RAM user may have access to only some of the resource groups under an Alibaba Cloud account. In this case, if the RAM user selects Account's All Resources in the top navigation bar, a message appears. It indicates that the RAM user is not authorized to access all resources.

Scenario 1: Add resources for different purposes to different resource groups

You can add clusters to be used in a test environment and those to be used in a production environment to different resource groups. During the test stage, select a cluster from the resource group for the test environment. This prevents misoperations that may occur on production clusters. When you launch a service, select a cluster from the resource group for the production environment to ensure that the service functions properly.

  1. Create resource groups Test Environment and Production Environment.
    For more information, see Create a resource group.
  2. Set the same administrator for the Test Environment and Production Environment resource groups.
    For more information, see Add RAM authorization.
  3. Create clusters TestEnv1 and TestEnv2.
    Specify the Test Environment resource group for the clusters.
  4. Create clusters ProdEnv1 and ProdEnv2.
    Specify the Production Environment resource group for the clusters.
  5. Use the administrator account of the Test Environment and Production Environment resource groups to log on to the .
  6. Select one of the resource groups from the top navigation bar.
    The clusters in the selected resource group are displayed in the cluster list. For example, if you select Test Environment, the TestEnv1 and TestEnv2 clusters are displayed.

Scenario 2: Manage users and their permissions by resource group

You can add clusters and projects of a department to an independent resource group and set an independent administrator for each resource group. This helps achieve separated management of users and permissions. In the following procedure, resource groups for a development department and a test department are used as an example.

  1. Create resource groups Develop Dept and Test Dept.
    For more information, see Create a resource group.
  2. Set different administrators for the Develop Dept and Test Dept resource groups.
    For more information, see Add RAM authorization.
  3. Create cluster ITCluster and project ITFlowProject and specify the Develop Dept resource group for them.
    For more information about how to create a cluster, see Create a cluster. For more information about how to create a project, see Manage projects.
  4. Create clusters FinanceCluster1 and FinanceCluster2. Specify the Test Dept resource group for the clusters.
    For more information about how to create a cluster, see Create a cluster.
  5. Use the administrator account of the Test Dept resource group to log on to the .
  6. Select the Test Dept resource group from the top navigation bar.
    The FinanceCluster1 and FinanceCluster2 clusters are displayed in the cluster list.