Help Center/ MapReduce Service/ User Guide/ Preparations/ Using IAM to Grant Access to MRS/ Using IAM Roles or Policies to Grant Access to MRS
Updated on 2026-09-24 GMT+08:00

Using IAM Roles or Policies to Grant Access to MRS

Identity and Access Management (IAM) allows you to manage permissions for the roles and policies described in MRS Role/Policy-based Permissions Management. With IAM, you can:

  • Create IAM users under your Huawei Cloud account for personnel based on your enterprise's organizational structure. Each IAM user has their own identity credentials for accessing MRS resources.
  • Grant users only the permissions required to perform a given task based on their job responsibilities.
  • Entrust a HUAWEI ID or a cloud service to perform efficient O&M on your MRS resources.

If your account does not require individual IAM users, skip this section.

Figure 1 shows the process flow of role/policy-based authorization.

Prerequisites

Before granting permissions to user groups, learn about MRS system-defined permissions described in MRS Role/Policy-based Permissions Management. To grant permissions for other services, learn about all system-defined permissions supported by IAM by referring to System-defined Policies/Roles.

Process Flow

Figure 1 Process for granting MRS permissions
  1. On the IAM console, create a user group and assign the required permissions to it.

    On the IAM console, create a user group and assign the MRS Minimal ReadOnlyAccess policy to the group.

  2. On the IAM console, create an IAM user and add the user to the user group you created.

    On the IAM console, create a user and add it to the user group created in 1.

  3. Log in as the IAM user and verify permissions.

    In the authorized region, perform the following operations:

    • Choose Service List > MapReduce Service. Then click Buy Cluster on the MRS console. If a message appears indicating that you have insufficient permissions to perform the operation (assuming that the current permissions include only MRS Minimal ReadOnlyAccess), the MRS Minimal ReadOnlyAccess policy is in effect.
    • Choose another service from Service List. If a message appears indicating that you have insufficient permissions to access the service (assuming that the current permissions include only MRS Minimal ReadOnlyAccess), the MRS ReadOnlyAccess policy is in effect.

Example Custom Policies

Custom policies can be created to supplement the system-defined policies of MRS. For the actions supported for custom policies, see Actions Supported by Identity Policy-based Authorization.

You can create custom policies in either of the following ways:

  • Visual editor: Select cloud services, actions, resources, and request conditions. This does not require knowledge of policy syntax.
  • JSON: Create a JSON policy or edit an existing one.

For details, see Creating a Custom Policy. The following lists examples of common MRS custom policies.

  • Example 1: Grant permission to submit, view, and stop jobs.
    {
        "Version": "1.1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "mrs:job:submit",
                    "mrs:job:get",
                    "mrs:job:stop"
                ]
            }
        ]
    }
  • Example 2: Grant permissions to deny cluster deletion.

    A policy with only "Deny" permissions must be used together with other policies. If the permissions granted to an IAM user contain both "Allow" and "Deny", the "Deny" permissions take precedence over the "Allow" permissions.

    If you want to grant users the permissions of the MRS Minimal FullAccess policy but prevent them from deleting clusters, you can create a custom policy that denies cluster deletion and attach both the MRS Minimal FullAccess policy and the deny policy to the users. According to the "Deny" precedence rule, the users will be able to perform all MRS operations except deleting clusters. The following is an example of a deny policy:

    {
        "Version": "1.1",
        "Statement": [
            {
                "Effect": "Deny",
                "Action": [
                    "mrs:cluster:delete"
                ]
            }
        ]
    }
  • Example 3: Create a custom policy containing multiple actions.

    A custom policy can contain the actions of one or more services that are of the same type (global or project-level).

    Example policy containing multiple actions:

    {
        "Version": "1.1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "mrs:cluster:list",
                    "mrs:cluster:get",
                    "mrs:host:list"
                ]
            },
            {
                "Effect": "Allow",
                "Action": [
                    "ecs:servers:get"
                ]
            }
        ]
    }

MRS Cluster Resources

A resource is an object that exists within a service. You can select MRS cluster resources by specifying their paths when creating a custom policy.

Table 1 MRS resources and their paths

Resource

Path

cluster

[Format]

MRS:*:*:cluster:Cluster ID

[Description]

Grant permissions on a specific resource to an IAM user. For example, to grant permissions on a specified MRS cluster to an IAM user, set cluster to Specify resource path and add the resource path. The cluster ID is used to specify the cluster.

To view the cluster ID, perform the following steps:

  1. On the MRS console, choose Active Clusters in the navigation pane on the left and click the name of the target cluster to access its details page.
  2. Click the Dashboard tab and obtain the cluster ID in the Basic Information area.

MRS Role/Policy-based Permissions Management

Table 2 and Table 3 list all system-defined policies for MRS. Table 3 outlines the minimum permissions required for system-defined identity policies, which you are advised to use first.
Table 2 MRS system policies

Policy

Description

Type

MRS FullAccess

Administrator permissions for MRS. Users with these permissions can perform all operations on MRS resources.

Fine-grained policy

MRS CommonOperations

Common user permissions for MRS. Users with these permissions can use MRS but cannot add or delete resources.

Fine-grained policy

MRS ReadOnlyAccess

Read-only permissions for MRS. Users with these permissions can only view MRS resources.

Fine-grained policy

MRS Administrator

Operation permissions:

  • Permissions to perform all operations on MRS
  • Permissions of the Tenant Guest and Server Administrator policies, which must also be granted to the users

    Tenant Guest: A global role, which must be assigned in the global project.

    Server Administrator: A project-level role, which must be assigned in the same project.

RBAC policy

Table 3 MRS system-defined policies with minimum required permissions

Policy

Description

Type

MRS Minimal FullAccess

Minimum set of administrator permissions for MRS, including permissions to create, scale out, scale in, delete, and query clusters, as well as upgrade cluster specifications. You are advised to use this policy together with the MRS Dependency Access policy to obtain complete administrator permissions.

Fine-grained policy

MRS Minimal CommonOperations

Minimum set of common user permissions for MRS, including permissions to query clusters, and manage tasks, files, tags, patches, O&M channels, and alarm configurations. You are advised to use this policy.

Fine-grained policy

MRS Minimal ReadOnlyAccess

Minimum set of read-only permissions for MRS, including the permission to query clusters. You are advised to use this policy.

Fine-grained policy

MRS Dependency Access

Sensitive permissions on which MRS depends, including permissions for data encryption, payment, and establishing network boundaries.

NOTE:

This policy grants highly privileged permissions to users. Use caution when configuring this policy.

Fine-grained policy

Table 4 lists the common operations supported by each system-defined policy of MRS. Select the required policy as needed.

Table 4 Common operations supported by each system-defined policy

Operation

MRS FullAccess/

MRS Minimal FullAccess

MRS CommonOperations/

MRS Minimal CommonOperations

MRS ReadOnlyAccess/

MRS Minimal ReadOnlyAccess

MRS Administrator

Creating a cluster

√

x

x

√

Resizing a cluster

√

x

x

√

Upgrading node specifications

√

x

x

√

Deleting a cluster

√

x

x

√

Querying cluster details

√

√

√

√

Listing all clusters

√

√

√

√

Configuring an auto scaling rule

√

x

x

√

Listing all hosts

√

√

√

√

Querying operation logs

√

√

√

√

Creating and executing a job

√

√

x

√

Stopping a job

√

√

x

√

Deleting a single job

√

√

x

√

Deleting jobs in batches

√

√

x

√

Querying job details

√

√

√

√

Listing jobs

√

√

√

√

Creating a folder

√

√

x

√

Deleting a file

√

√

x

√

Listing files

√

√

√

√

Managing cluster tags in batches

√

√

x

√

Creating a single cluster tag

√

√

x

√

Deleting a single cluster tag

√

√

x

√

Listing resources by tag

√

√

√

√

Querying cluster tags

√

√

√

√

Accessing MRS Manager

√

√

x

√

Listing all patches

√

√

√

√

Installing a patch

√

√

x

√

Uninstalling a patch

√

√

x

√

Authorizing O&M channels

√

√

x

√

Sharing O&M channel logs

√

√

x

√

Listing alarms

√

√

√

√

Subscribing to alarm notifications

√

√

x

√

Submitting an SQL statement

√

√

x

√

Querying SQL query results

√

√

x

√

Canceling a SQL execution task

√

√

x

√