All Products
Search
Document Center

ApsaraDB for MongoDB:How do I configure RAM user permissions on ApsaraDB for MongoDB

Last Updated:Jun 19, 2024

To implement fine-grained access control and improve account security, you can use Resource Access Management (RAM) to grant the management permissions on ApsaraDB for MongoDB to RAM users. In this way, RAM users can manage ApsaraDB for MongoDB instances.

Prerequisites

A RAM user is created. For more information, see Create a RAM user.

Grant permissions to a RAM user

  1. Log on to the RAM console as a RAM administrator.

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

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

    image

    You can also select multiple RAM users and click Add Permissions in the lower part of the page to grant permissions to the RAM users at a time.

  4. In the Grant Permission panel, grant permissions to the RAM user.

    1. Configure the Resource Scope parameter.

    2. Configure the Principal parameter.

      The principal is the RAM user to which you want to grant permissions. The current RAM user is automatically selected.

    3. Configure the Policy parameter.

      A policy contains a set of permissions. Policies can be classified into system policies and custom policies. You can select multiple policies at a time.

      • System policies: policies that are created by Alibaba Cloud. You can use but cannot modify these policies. Version updates of the policies are maintained by Alibaba Cloud. For more information, see Services that work with RAM.

        Note

        The system automatically identifies high-risk system policies, such as AdministratorAccess and AliyunRAMFullAccess. We recommend that you do not grant unnecessary permissions by attaching high-risk policies.

      • Custom policies: You can manage and update custom policies based on your business requirements. You can create, update, and delete custom policies. For more information, see Create a custom policy.

    4. Click Grant permissions.

  5. Click Close.

System policies

You can use system policies to grant RAM users permissions on all ApsaraDB for MongoDB resources. ApsaraDB MongoDB provides the following system policies:
  • AliyunMongoDBFullAccess: grants a RAM user full management permissions on ApsaraDB for MongoDB.
  • AliyunMongoDBReadOnlyAccess: grants a RAM user the read-only permissions on ApsaraDB for MongoDB.

Custom policies

You can also use custom policies to grant RAM users specific operation permissions on specific instances. For information about the syntax of custom policies, see Policy structure and syntax.

Use RAM to grant permissions on ApsaraDB for MongoDB resources

You can use RAM to grant permissions only on ApsaraDB for MongoDB instances. When you use RAM to grant permissions, you can describe resources in the Resource field of the policy.
Resource typeResource description in the policy
dbinstanceacs:dds:$regionid:$accountid:dbinstance/$dbinstanceid
The following table describes the parameters used in the preceding resource description.
ParameterDescription
$regionidThe region ID. This value can be set to a wildcard asterisk (*).
$dbinstanceidThe instance ID. This value can be set to a wildcard asterisk (*).
$accountidThe ID of your Alibaba Cloud account. This value can be set to a wildcard asterisk (*).

Operations that you can authorize RAM users to call

In the RAM console, you can authorize RAM users to call the following operations on an ApsaraDB for MongoDB resource.

OperationDescription
CreateDBInstanceCreates an ApsaraDB for MongoDB instance.
ModifyDBInstanceSpecModifies the configurations of an ApsaraDB for MongoDB instance.
DeleteDBInstanceDeletes an ApsaraDB for MongoDB instance.
DescribeDBInstancesQueries an ApsaraDB for MongoDB instance.
RestartDBInstanceRestarts an ApsaraDB for MongoDB instance.
DescribeSecurityIpsQueries the whitelists of an ApsaraDB for MongoDB instance.
ModifySecurityIpsModifies the whitelists of an ApsaraDB for MongoDB instance.
ResetAccountPasswordResets the account password for an ApsaraDB for MongoDB instance.
DescribeBackupPolicyQueries the backup policy of an ApsaraDB for MongoDB instance.
ModifyBackupPolicyModifies the backup policy of an ApsaraDB for MongoDB instance.
CreateBackupCreates a backup for an ApsaraDB for MongoDB instance.
RestoreDBInstanceRestores the data in an ApsaraDB for MongoDB instance.
DescribeAccountsQueries the database accounts of an ApsaraDB for MongoDB instance.
DescribeDBInstancePerformanceQueries the state of an ApsaraDB for MongoDB instance.
DescribeReplicaSetRoleQueries the primary/secondary attribute of an ApsaraDB for MongoDB instance.
ModifyDBInstanceDescriptionModifies the description of an ApsaraDB for MongoDB instance.
ModifyAccountDescriptionModifies the database accounts of an ApsaraDB for MongoDB instance.
DescribeDBInstanceAttributeQueries the attributes of an ApsaraDB for MongoDB instance.
RenewDBInstanceRenews an ApsaraDB for MongoDB instance.
ModifyDBInstanceNetworkTypeModifies the network type of an ApsaraDB for MongoDB instance.