This topic describes how to use a Resource Access Management (RAM) role to grant permissions across Alibaba Cloud accounts. Two enterprises (Enterprise A and Enterprise B) are used as examples. To authorize Enterprise B to access specified resources of Enterprise A, Enterprise A can create and assign a RAM role to Enterprise B. Then, Enterprise B can assume the RAM role and access the specified resources.
Prerequisites
An account alias is configured for your Alibaba Cloud account. For more information, see View and modify the default domain name.
Background information
Enterprise A has purchased multiple types of Alibaba Cloud resources, such as Elastic Compute Service (ECS) instances, ApsaraDB RDS instances, Server Load Balancer (SLB) instances, and Object Storage Service (OSS) buckets. Enterprise A wants to authorize Enterprise B to access specified resources of Enterprise A.
Enterprise A has the following requirements:
- Enterprise A serves only as a cloud resource owner. Enterprise A can authorize Enterprise B to maintain, monitor, and manage specified cloud resources of Enterprise A.
- If an employee joins or leaves Enterprise B, Enterprise A does not need to change permissions. Enterprise B can grant its RAM users fine-grained permissions on cloud resources of Enterprise A. The RAM user credentials can be assigned to either employees or applications.
- If the agreement between Enterprise A and Enterprise B ends, Enterprise A can revoke the permissions from Enterprise B.
Solution
In this example, Enterprise A needs to authorize employees of Enterprise B to manage ECS resources of Enterprise A. Enterprise A has an Alibaba Cloud account named Account A and Enterprise B has an Alibaba Cloud account named Account B.
- The ID of Account A is
123456789012****
and the account alias iscompany-a
. - The ID of Account B is
134567890123****
and the account alias iscompany-b
.
- Enterprise A uses Account A to create a RAM role, grants the required permissions
to the RAM role, and then authorizes Account B to assume this role.
For more information, see Grant permissions across Alibaba Cloud accounts.
- If an employee of Enterprise B needs to use a RAM user to assume this role, Enterprise
B can use Account B to grant the required permissions to the RAM user. Then, the RAM
user assumes the RAM role to access the resources of Account A.
For more information, see Access resources across Alibaba Cloud accounts.
- If the agreement between Enterprise A and Enterprise B ends, Enterprise A can revoke
the permissions from Account B. Then, the RAM users of Account B no longer have the
permissions of the RAM role.
For more information, see Revoke permissions across Alibaba Cloud accounts.
Grant permissions across Alibaba Cloud accounts
Access resources across Alibaba Cloud accounts
After Enterprise A uses Account A to grant the required permissions to Account B,
the RAM user Alice
of Account B can access ECS resources of Account A by assuming the RAM role. An employee
of Enterprise B can perform the following steps to assume the RAM role as a RAM user:
Revoke permissions across Alibaba Cloud accounts
Enterprise A can use Account A to revoke the permissions to assume the RAM role ecs-admin
from Account B. Enterprise A can perform the following steps to revoke the permissions
to assume the RAM role: