Updated on 2022-02-22 GMT+08:00

Creating MRS Custom Policies

Custom policies can be created to supplement the system-defined policies of MRS. For the actions that can be added to custom policies, see Permissions Policies and Supported Actions.

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: Edit JSON policies from scratch or based on an existing policy.

For details, see Creating a Custom Policy.

Example Custom Policies

  • Example 1: Allowing users to create MRS clusters only
    {
        "Version": "1.1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "mrs:cluster:create",
                    "ecs:*:*",
                    "bms:*:*",
                    "evs:*:*",
                    "vpc:*:*"
                ]
            }
        ]
    }
  • Example 2: Allowing users to resize an MRS cluster
    { 
        "Version": "1.1", 
        "Statement": [ 
            { 
                "Effect": "Allow", 
                "Action": [ 
                    "mrs:cluster:resize" 
                ] 
            } 
        ] 
    }
  • Example 3: Allowing users to create a cluster, create and execute a job, and delete a single job, but denying cluster deletion
    {
        "Version": "1.1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "mrs:cluster:create",
                    "mrs:job:submit",
                    "mrs:job:delete"
                ]
            },
            {
                "Effect": "Deny",
                "Action": [
                    "mrs:cluster:delete"
                ]
            }
        ]
    }