All Products
Search
Document Center

Key Management Service:Authorize Secrets Manager to manage AccessKey pairs of RAM users

Last Updated:Mar 24, 2025

Before you can use Secrets Manager to manage Resource Access Management (RAM) secrets, you must authorize Secrets Manager to manage AccessKey pairs of RAM users. To perform the authorization, you can assign a RAM role with the required permissions to Secrets Manager. This topic describes how to authorize Secrets Manager to manage AccessKey pairs of RAM users.

Step 1: Create a custom policy

  1. Log on to the RAM console as a RAM user who has administrative rights.

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

  3. On the Policies page, click Create Policy.

    image

  4. Click JSON and enter the following script:

    {
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ram:ListAccessKeys",
                    "ram:CreateAccessKey",
                    "ram:DeleteAccessKey",
                    "ram:UpdateAccessKey"
                ],
                "Resource": "*"
            }
        ],
        "Version": "1"
    }
  5. Optional. Click Optimize in the upper part and click Perform to optimize the policy.

    The system performs the following operations during the advanced optimization:

    • Split resources or conditions that are incompatible with actions.

    • Narrow down resources.

    • Deduplicate or merge policy statements.

    The optimized document may not be as expected.

  6. Click OK.

  7. On the page that appears, configure the Name and Description parameters, then click OK.

    Set the Name parameter to AliyunKMSManagedRAMCrendentialsRolePolicy.

Step 2: Create a RAM role and attach the policy to the RAM role

  1. Log on to the RAM console as a RAM user who has administrative rights.

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

  3. On the Roles page, click Create Role.

    image

  4. On the Create Role page, set Principal Type to Cloud Service, select an Key Management Service for the Principal Name parameter, and then click OK.

    image

  5. Set the Role Name parameter to AliyunKMSManagedRAMCrendentialsRole.

  6. Click OK.

  7. Select the Permissions tab and click Grant Permission to grant permissions to the role.

    1. In the Grant Permission panel, click All Types and select Custom Policy.

    2. Select the AliyunKMSManagedRAMCrendentialsRolePolicy

    3. Click Grant permissions.