You can group your resources based on usage, permissions, and regions. This way, you can manage resources based on users and projects in a hierarchical manner. 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

When you use resource groups, take note of the following points:
  • A resource group can contain resources in different regions. For example, Resource Group A contains clusters in the China (Hangzhou) region and clusters in the China (Shanghai) region.
  • A resource group can contain different types of resources. For example, Resource Group A contains resources such as clusters, ECS instances, and projects.
  • Clusters and projects that belong to the same Alibaba Cloud account and reside in the same region can be associated across resource groups. For example, your Alibaba Cloud account can access Resource Group A and Resource Group B. Resource Group A contains a project that resides in the China (Beijing) region. Resource Group B contains a cluster that also resides in the China (Beijing) region. In this case, you can run a job of the project in the cluster.
  • RAM users have access to resource groups as authorized. For example, if you authorize a RAM user to manage all Alibaba Cloud resources in your Alibaba Cloud account, all resource groups in your Alibaba Cloud account are accessible to the RAM user.

Limits

  • You can create and manage a resource group and authorize RAM users to access the 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.
  • You cannot move resources across resource groups that belong to different Alibaba Cloud accounts.
    Notice If you move a node resource to a different resource group, the cluster to which the node resource belongs remains in the original resource group. 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.

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 the default resource group. This section describes how to specify resource groups when you create a cluster and a project.

Note When you create a resource, you can specify only a resource group to which you have access.
  • Specify a resource group when you create a cluster
    1. Log on to the Alibaba Cloud EMR console.
    2. In the top navigation bar, select the region in which you want to create a cluster.
    3. Click Cluster Wizard.
    4. After you configure the software and hardware parameters, go to the Basic Settings step and configure the parameters in the Basic Information section. Then, expand the Advanced Settings section and select an existing resource group from the Select Resource Group drop-down list.

      If you want to create a 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 when you create a project
    1. Log on to the Alibaba Cloud EMR console.
    2. In the top navigation bar, select the region in which you want to create a project.
    3. Click the Data Platform tab.
    4. On the Data Platform tab, click Create Project in the upper-right corner.
    5. In the Create Project dialog box, configure the Project Name and Project Description parameters and select an existing resource group from the Select Resource Group drop-down list.

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

    6. Click Create.

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

Scenarios

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

Scenario 1: Add resources that serve different purposes to different resource groups

You can add clusters to be used in a test environment and clusters to be used in a production environment to different resource groups. During tests, 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 works as expected.

  1. Create two resource groups named Test Environment and Production Environment.
    For more information, see Create a resource group.
  2. Configure the same administrator for the Test Environment and Production Environment resource groups.
    For more information, see Add RAM authorization.
  3. Create two clusters named TestEnv1 and TestEnv2.
    Specify the Test Environment resource group for the clusters.
  4. Create two clusters named 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 Alibaba Cloud EMR console.
  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 user permissions by resource group

You can add clusters and projects of a department to an independent resource group and configure an independent administrator for the resource group. This way, you can separately manage the users and user permissions of each resource group. In the following procedure, resource groups for a development department and a test department are created.

  1. Create two resource groups named Develop Dept and Test Dept.
    For more information, see Create a resource group.
  2. Configure different administrators for the Develop Dept and Test Dept resource groups.
    For more information, see Add RAM authorization.
  3. Create a cluster named ITCluster and a project named ITFlowProject. Select the Develop Dept resource group for the cluster and project.
    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 two clusters named FinanceCluster1 and FinanceCluster2. Select the Test Dept resource group for the clusters.
  5. Use the administrator account of the Test Dept resource group to Log on to the Alibaba Cloud EMR console.
  6. Select the Test Dept resource group in the top navigation bar.
    The FinanceCluster1 and FinanceCluster2 clusters are displayed in the cluster list.