All Products
Search
Document Center

AnalyticDB:RAM users and permissions

Last Updated:Mar 28, 2026

When multiple team members need access to AnalyticDB for MySQL clusters, sharing an Alibaba Cloud account's AccessKey pair is a common but risky practice: the key is more likely to be compromised, and you lose visibility into who did what. Resource Access Management (RAM) solves both problems by letting you create individual users with only the permissions their role requires.

How RAM ownership works

  • RAM users belong to an Alibaba Cloud account and cannot own resources. All clusters—even those created by a RAM user—are owned by the Alibaba Cloud account.

  • When a RAM user creates a cluster, only that RAM user and the Alibaba Cloud account owner can access it by default. Other RAM users must be explicitly granted permissions.

Prerequisites

Before you begin, ensure that you have:

  • An Alibaba Cloud account with administrator access

  • At least one AnalyticDB for MySQL cluster to grant access to

Create a RAM user

  1. Log on to the RAM console.

  2. In the navigation pane on the left, choose Identities > Users.

  3. On the Users page, click Create User. Enter a Logon Name and a Display Name.

    To create multiple RAM users at once, click Add User.
  4. In the Access Mode section, select the access mode that matches how the user will interact with your clusters:

    Important

    Select only one access mode per RAM user. Limiting access to a single mode prevents a user who leaves your organization from retaining an alternative way in.

    Access modeWhen to use
    Console AccessThe user needs to log on to the Alibaba Cloud console. Configure a logon password, optionally require a password reset upon next logon, and optionally enable multi-factor authentication (MFA).
    Using permanent AccessKey to accessThe user needs programmatic access via development tools or APIs. An AccessKey pair is created automatically.
  5. Click OK.

Grant permissions to a RAM user

Choose a system policy

RAM provides three built-in system policies for AnalyticDB for MySQL. Pick the one that matches the user's role:

PolicyPermissionsRecommended for
AliyunADBReadOnlyAccessView cluster information; no modificationsAnalysts, auditors
AliyunADBDeveloperAccessRun queries and manage data; cannot create, delete, or reconfigure clusters, or attach RAM usersDevelopers, data engineers
AliyunADBFullAccessFull cluster management including creation, deletion, and configuration changesCluster administrators

All three policies apply to Enterprise Edition, Basic Edition, and Data Lakehouse Edition clusters. For Data Warehouse Edition (V3.0) clusters, only AliyunADBReadOnlyAccess and AliyunADBFullAccess are available.

Choosing the right policy for common scenarios:

ScenarioRecommended policy
User only needs to view cluster details or run reportsAliyunADBReadOnlyAccess
User needs to run queries and manage data in the SQL or Spark editorAliyunADBDeveloperAccess
User needs to create, delete, or reconfigure clustersAliyunADBFullAccess
User accesses only via API or CLI, not the consoleGrant the matching policy above; no additional console permissions are needed
Warning

Grant the least privilege needed for the role. Over-privileged users can accidentally delete clusters, change configurations, or cause data loss. If a user only needs to run queries, use AliyunADBDeveloperAccess instead of AliyunADBFullAccess.

Attach a system policy

  1. Log on to the RAM console.

  2. In the navigation pane on the left, choose Identities > Users.

  3. On the Users page, find the target RAM user and click Add Permissions in the Actions column.

  4. On the Add Permissions page, select System Policy from the drop-down list. Search for the policy by name and click it to add it to the Selected section.

  5. Click OK.

After the policy is attached, the RAM user can access or manage your AnalyticDB for MySQL cluster.

Create a custom policy for a specific cluster

System policies apply to all clusters in your account. To restrict a RAM user to a single cluster—or a specific set of clusters—create a custom policy.

Create the custom policy

  1. Log on to the RAM console.

  2. In the navigation pane on the left, choose Permissions > Policies.

  3. Click Create Policy and select the JSON tab.

  4. Paste the policy JSON for your use case: Full management of cluster `am-xxx`:

    {
        "Version": "1",
        "Statement": [
            {
                "Action": ["adb:DescribeDBClusters", "adb:ListTagResources"],
                "Resource": "acs:adb:*:*:dbcluster/*",
                "Effect": "Allow"
            },
            {
                "Action": "adb:*",
                "Resource": ["acs:adb:*:*:dbcluster/am-xxx"],
                "Effect": "Allow"
            }
        ]
    }

    Read-only access to cluster `am-xxx`:

    {
        "Version": "1",
        "Statement": [
            {
                "Action": ["adb:DescribeDBClusters", "adb:ListTagResources"],
                "Resource": "acs:adb:*:*:dbcluster/*",
                "Effect": "Allow"
            },
            {
                "Action": "adb:Describe*",
                "Resource": ["acs:adb:*:*:dbcluster/am-xxx"],
                "Effect": "Allow"
            }
        ]
    }

    Replace am-xxx with your actual cluster ID. To include multiple clusters, add their IDs to the Resource array in Statement 2:

    "Resource": ["acs:adb:*:*:dbcluster/am-xxx", "acs:adb:*:*:dbcluster/am-yyy"]
  5. Click OK, enter a policy name and description, then click OK again.

  6. Attach the custom policy to the RAM user following the steps in Attach a system policy.

Next steps