Grants role-based access control (RBAC) permissions to Resource Access Management (RAM) users or RAM roles. System policies can be attached to RAM users to grant only the operation permissions on Distributed Cloud Container Platform for Kubernetes (ACK One) cluster resources. The operation permissions include creating and viewing instances. If you want to perform operations on Kubernetes resources in a specific cluster by using a RAM user or assuming a RAM role, such as creating GitOps applications and Argo workflows, you must grant RBAC permissions to the RAM user or RAM role to perform operations on the specified ACK One cluster and namespace. This topic describes how to grant RBAC permissions to a RAM user or RAM role.
Operation description
- To call this API operation to grant permissions to a RAM user or RAM role on a specific cluster, you must use an Alibaba Cloud account, the account that is used to create the cluster, or a RAM user that has the cluster administrator permissions. A regular RAM user does not have the permissions to call this operation.
- Before you grant RBAC permissions to a RAM user or RAM role on a cluster, you must grant the operation permissions to the RAM user or RAM role on the specified cluster. For more information, see Attach a system permission policy to a RAM user or RAM role.
For more information, see Authorization overview.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| adcp:GrantUserPermission | create | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| RoleType | string | Yes | The authorization type. Valid values:
| cluster |
| RoleName | string | Yes | The predefined role. Valid values:
The value of RoleName and that of RoleType must meet the following requirements:
| admin |
| ClusterId | string | Yes | The cluster ID. | c102fe5f1ee5d4c87a68121a77d8b**** |
| Namespace | string | No | The name of the namespace.
| default |
| UserId | string | Yes | The ID of the RAM user or RAM role. | 2176**** |
| IsRamRole | boolean | No | The entity to which the permissions are granted. A value of | false |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "2D676EFC-8C04-5CCE-A08E-BB97D24B47E8"
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2023-07-28 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
| 2023-05-22 | The request parameters of the API has changed | View Change Details |
