RAM authorization

Updated at:

Resource Access Management (RAM) is a service provided by Alibaba Cloud to manage user identities and resource access permissions. Using RAM helps you avoid sharing your Alibaba Cloud account keys with other users and allows you to grant users the least privilege access. RAM uses permission policies to define authorizations. This topic describes the actions, resources, and conditions that Resource Management defines for RAM permission policies. The RamCode of Resource Management is resourcecenter,resourcemanager,tag,resourcesharing , and the supported authorization granularity is RESOURCE . For the resource authorization scope of each action, see the Action table.

General structure of a policy

Permission policies support the JSON format. The following example shows the structure of a policy that uses the Action element. Values in angle brackets (<>) are placeholders. Replace them with actual values.

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "<Effect>",
      "Action": "<Action>",
      "Resource": "<Resource>",
      "Condition": {
        "<Condition_operator>": {
          "<Condition_key>": [
            "<Condition_value>"
          ]
        }
      }
    }
  ]
}        

The following list describes the fields and placeholders in the policy:

  • Effect: Specifies the authorization result. Valid values: Allow and Deny.

  • Action: Specifies one or more operations that are allowed or denied.

  • Resource: Specifies the specific objects affected by the operations. You can use Alibaba Cloud Resource Names (ARNs) to describe specific resources.

  • Condition: Specifies the conditions for the authorization to take effect. This field is optional.

  • Condition operator: Specifies the conditional operators. Different types of conditions support different conditional operators.

  • Condition_key: Specifies the condition keys.

  • Condition_value: Specifies the condition values.

Action

The following table lists the RAM actions defined by Resource Management. These actions can be used in the Action element of RAM permission policies.

  • Action: A specific RAM permission point. In most cases, it has the same name as the corresponding OpenAPI.

  • OpenAPI: The OpenAPI associated with the RAM action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that support authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding ARN in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The product-level condition keys supported by the action. Common condition keys are not included. For more information, see Common condition keys.

  • Dependent action: Other action permissions required to perform the action.

Action

OpenAPI

Access level

Resource type

Condition key

Dependent action

resourcemanager:DeleteAutoGroupingRule DeleteAutoGroupingRule delete

*All Resource

*

None None
resourcemanager:EnableResourceGroupNotification EnableResourceGroupNotification none

*All Resource

*

None None
resourcemanager:GetAutoGroupingRule GetAutoGroupingRule get

*All Resource

*

None None
resourcemanager:UpdateAutoGroupingConfig UpdateAutoGroupingConfig none

*All Resource

*

None None
resourcemanager:GetResourceGroupAdminSetting GetResourceGroupAdminSetting none

*All Resource

*

None None
resourcemanager:GetAutoGroupingStatus GetAutoGroupingStatus get

*All Resource

*

None None
resourcemanager:EnableAutoGrouping EnableAutoGrouping none

*All Resource

*

None None
resourcemanager:CreateAutoGroupingRule CreateAutoGroupingRule create

*All Resource

*

None None
resourcemanager:UpdateAutoGroupingRule UpdateAutoGroupingRule update

*All Resource

*

None None
resourcemanager:DisableAutoGrouping DisableAutoGrouping none

*All Resource

*

None None
resourcemanager:DisableResourceGroupNotification DisableResourceGroupNotification none

*All Resource

*

None None
resourcemanager:UpdateResourceGroupAdminSetting UpdateResourceGroupAdminSetting update

*All Resource

*

None None
resourcemanager:GetResourceGroupNotificationSetting GetResourceGroupNotificationSetting none

*All Resource

*

None None
resourcemanager:ListAutoGroupingRules ListAutoGroupingRules list

*All Resource

*

None None
resourcemanager:ListAutoGroupingRemediations ListAutoGroupingRemediations list

*All Resource

*

None None

Resource

The following table lists the resource types and ARN formats defined by Resource Management. The Resource element of RAM policy statements specifies the resources to which the statement applies. Notes:

  • {#} in an ARN is a variable placeholder. Replace it with the actual value. For example, replace {#ramcode} with the actual RAM code of the cloud service.

  • * in an ARN indicates all. For example:

    • {#resourceType} set to *: all resources.

    • {#regionId} set to *: all regions.

    • {#accountId} set to *: all Alibaba Cloud accounts.

Resource type

ARN

Account
  • acs:resourcemanager:*:{#accountId}:account/{#ResourceDirectoryPath}
  • acs:resourcemanager::{#accountId}:account/{#ResourceDirectoryPath}
  • acs:resourcemanager:*:{#accountId}:account/*
  • acs:resourcemanager:*:{#accountId}:*
Folder
  • acs:resourcemanager:*:{#accountId}:folder/{#ResourceDirectoryPath}
  • acs:resourcemanager:*:{#accountId}:folder/*
ResourceDirectory
  • acs:resourcemanager:*:{#accountId}:*
  • acs:resourcemanager::{#accountId}:*
ControlPolicy
  • acs:resourcemanager:*:{#accountId}:policy/controlpolicy/{#PolicyId}
  • acs:resourcemanager:*:{#accountId}:policy/controlpolicy/*
Handshake
  • acs:resourcemanager:*:{#accountId}:handshake/{#HandshakeId}
  • acs:resourcemanager:*:{#accountId}:handshake/*
TrustedService
  • acs:resourcemanager:*:{#accountId}:*

Condition

The following table lists the product-level condition keys defined by Resource Management. Specify them in the Condition element of RAM policy statements to define the conditions under which the statement takes effect. Use conditional operators that match the data type of the condition key. If the operator does not match, the statement does not take effect. For more information about conditional operators, see Condition operator.

Condition key

Description

Data type

resourcesharing:ResourceArn The resource ARN. Example value: acs:vpc:cn-shanghai:131993166204****:vswitch/vsw-7xv4sfwo86u2etl64****. String
resourcesharing:RequestedAllowExternalTargets Specifies whether to allow sharing with accounts outside the resource directory. Example value: false. Boolean
ram:ServiceName The trusted cloud service identifier for the service-linked role. Example value: actiontrail.aliyuncs.com. String
resourcesharing:Target Example values: resource directory ID, RDPath of the folder, RDPath of the account (for accounts within the organization), or account ID (for accounts outside the organization). String
resourcesharing:RequestedResourceType The resource type. Example value: VSwitch. String
ram:MaxSessionDuration Specifies the maximum session duration of the role, in seconds. Example: 3600 Numeric
ram:PolicyARN The RAM policy resource name. Example value for a system policy: acs:ram::system:policy/<PolicyName>. Example value for a custom policy: acs:ram::<account ID>:policy/<PolicyName>. String

References

For information about conditional operators, custom policies, and authorization operations, see the following documents: