Resource Access Management (RAM) is a service provided by Alibaba Cloud to manage user identities and resource access permissions. You can use RAM to prevent RAM users from sharing the AccessKey pairs of your Alibaba Cloud account. You can also use RAM to grant minimum permissions to RAM users. RAM uses policies to define permissions.
This topic describes the elements, such as Action, Resource, and Condition, which are defined by Redis. You can use the elements to create policies in RAM. The code (RamCode) in RAM that is used to indicate Redis is kvstore. You can grant permissions on Redis at the RESOURCE.
General structure of a policy
Policies can be stored as JSON files. The following code provides an example on the general structure of a policy:
{
"Version": "1",
"Statement": [
{
"Effect": "<Effect>",
"Action": "<Action>",
"Resource": "<Resource>",
"Condition": {
"<Condition_operator>": {
"<Condition_key>": [
"<Condition_value>"
]
}
}
}
]
}
- Effect: specifies the authorization effect. Valid values: Allow, Deny.
- Action: specifies one or more API operations that are allowed or denied. For more information, see the Action section of this topic.
- Resource: specifies one or more resources to which the policy applies. You can use an Alibaba Cloud Resource Name (ARN) to specify a resource. For more information, see the Resource section of this topic.
- Condition: specifies one or more conditions that are required for the policy to take effect. This is an optional field. For more information, see the Condition section of this topic.
- Condition_operator: specifies the conditional operators. Different types of conditions support different conditional operators. For more information, see Policy elements.
- Condition_key: specifies the condition keys.
- Condition_value: specifies the condition values.
Action
Redis defines the values that you can use in theAction
element of a policy statement. The following table describes the values.- Operation: the value that you can use in the Action element to specify the operation on a resource.
- API operation: the API operation that you can call to perform the operation.
- 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:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition key: the condition keys that are defined by the Alibaba Cloud service. The Condition key column does not list the common condition keys that are defined by Alibaba Cloud. For more information about the common condition keys, see Generic Condition Keyword.
- 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.
Actions | API operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|---|
kvstore:AddShardingNode | AddShardingNode | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:AllocateDirectConnection | AllocateDirectConnection | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:AllocateInstancePublicConnection | AllocateInstancePublicConnection | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:CheckCloudResourceAuthorized | CheckCloudResourceAuthorized | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:CreateAccount | CreateAccount | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:CreateBackup | CreateBackup | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:CreateCacheAnalysisTask | CreateCacheAnalysisTask | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:CreateGlobalDistributeCache | CreateGlobalDistributeCache | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:CreateInstance | CreateInstance | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/* | kvstore:InstanceClass | None |
kvstore:CreateInstances | CreateInstances | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/* | kvstore:InstanceClass | None |
kvstore:CreateTairInstance | CreateTairInstance | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/* | kvstore:InstanceClass | None |
kvstore:DeleteAccount | DeleteAccount | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DeleteInstance | DeleteInstance | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DeleteShardingNode | DeleteShardingNode | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:DescribeAccounts | DescribeAccounts | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeAuditLogConfig | DescribeAuditLogConfig | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:DescribeAuditRecords | DescribeAuditRecords | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeBackupPolicy | DescribeBackupPolicy | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeBackupTasks | DescribeBackupTasks | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:DescribeBackups | DescribeBackups | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeCacheAnalysisReport | DescribeCacheAnalysisReport | Read | dbinstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#dbInstanceId} | None | None |
kvstore:DescribeCacheAnalysisReportList | DescribeCacheAnalysisReportList | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeClusterMemberInfo | DescribeClusterMemberInfo | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:DescribeDBInstanceNetInfo | DescribeDBInstanceNetInfo | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeDedicatedClusterInstanceList | DescribeDedicatedClusterInstanceList | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/*DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeEncryptionKey | DescribeEncryptionKey | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:DescribeEncryptionKeyList | DescribeEncryptionKeyList | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:DescribeEngineVersion | DescribeEngineVersion | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:DescribeGlobalDistributeCache | DescribeGlobalDistributeCache | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeHistoryMonitorValues | DescribeHistoryMonitorValues | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | kvstore:ResourceTag | None |
kvstore:DescribeInstanceAttribute | DescribeInstanceAttribute | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeInstanceAutoRenewalAttribute | DescribeInstanceAutoRenewalAttribute | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/*DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeInstanceSSL | DescribeInstanceSSL | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeInstanceTDEStatus | DescribeInstanceTDEStatus | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:DescribeInstances | DescribeInstances | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/*DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeInstancesOverview | DescribeInstancesOverview | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId}DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId}DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:DescribeIntranetAttribute | DescribeIntranetAttribute | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeLogicInstanceTopology | DescribeLogicInstanceTopology | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/*DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeParameterModificationHistory | DescribeParameterModificationHistory | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId} | None | None |
kvstore:DescribeParameters | DescribeParameters | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId} | None | None |
kvstore:DescribeRoleZoneInfo | DescribeRoleZoneInfo | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:DescribeRunningLogRecords | DescribeRunningLogRecords | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeSecurityGroupConfiguration | DescribeSecurityGroupConfiguration | Read | dbinstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#dbInstanceId} | None | None |
kvstore:DescribeSecurityIps | DescribeSecurityIps | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:DescribeSlowLogRecords | DescribeSlowLogRecords | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#dbInstanceId} | None | None |
kvstore:DescribeTasks | DescribeTasks | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId}DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId}DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:EnableAdditionalBandwidth | EnableAdditionalBandwidth | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:FlushExpireKeys | FlushExpireKeys | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#dbInstanceId} | None | None |
kvstore:FlushInstance | FlushInstance | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:GrantAccountPrivilege | GrantAccountPrivilege | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:InitializeKvstorePermission | InitializeKvstorePermission | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:ListTagResources | ListTagResources | List | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/* | None | None |
kvstore:MigrateToOtherZone | MigrateToOtherZone | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyAccountDescription | ModifyAccountDescription | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyAccountPassword | ModifyAccountPassword | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyAuditLogConfig | ModifyAuditLogConfig | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#InstanceId} | kvstore:DbAudit | None |
kvstore:ModifyBackupPolicy | ModifyBackupPolicy | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyDBInstanceConnectionString | ModifyDBInstanceConnectionString | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyInstanceAttribute | ModifyInstanceAttribute | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyInstanceAutoRenewalAttribute | ModifyInstanceAutoRenewalAttribute | Write | acs:kvstore:{#regionId}:{#accountId}:instance/{#InstanceId} | None | None |
kvstore:ModifyInstanceConfig | ModifyInstanceConfig | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyInstanceMaintainTime | ModifyInstanceMaintainTime | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyInstanceMajorVersion | ModifyInstanceMajorVersion | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyInstanceMinorVersion | ModifyInstanceMinorVersion | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyInstanceNetExpireTime | ModifyInstanceNetExpireTime | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyInstanceSSL | ModifyInstanceSSL | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | kvstore:SSLEnabled | None |
kvstore:ModifyInstanceSpec | ModifyInstanceSpec | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifyInstanceTDE | ModifyInstanceTDE | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | kvstore:TDEStatus | None |
kvstore:ModifyInstanceVpcAuthMode | ModifyInstanceVpcAuthMode | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | kvstore:VpcAuthMode | None |
kvstore:ModifyIntranetAttribute | ModifyIntranetAttribute | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ModifySecurityGroupConfiguration | ModifySecurityGroupConfiguration | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#dbInstanceId} | None | None |
kvstore:ModifySecurityIps | ModifySecurityIps | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ReleaseDirectConnection | ReleaseDirectConnection | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ReleaseInstancePublicConnection | ReleaseInstancePublicConnection | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:RenewInstance | RenewInstance | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:ResetAccountPassword | ResetAccountPassword | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:RestartInstance | RestartInstance | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#dbInstanceId} | None | None |
kvstore:RestoreInstance | RestoreInstance | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:SwitchInstanceHA | SwitchInstanceHA | Read | DBInstance acs:kvstore:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} | None | None |
kvstore:SwitchInstanceProxy | SwitchInstanceProxy | Read | None | None | |
kvstore:SwitchNetwork | SwitchNetwork | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:SyncDtsStatus | SyncDtsStatus | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:TagResources | TagResources | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/* | None | None |
kvstore:TransformToPrePaid | TransformToPrePaid | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId} | None | None |
kvstore:UntagResources | UntagResources | Write | DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/* | None | None |
Resource
Redis defines the values that you can use in theResource
. You can attach the policy to a RAM user or a RAM role so that the RAM user or the RAM role can perform a specific operation on a specific resource.
The ARN is the unique identifier of the resource on Alibaba Cloud. Take note of the following items:{#}
indicates a variable. {#} must be replaced with an actual value. For example,{#ramcode}
must be replaced with the actual code of an Alibaba Cloud service in RAM.- An asterisk (
*
) is used as a wildcard. Examples:{#resourceType}
is set to*
, all resources are specified.{#regionId}
is set to*
, all regions are specified.{#accountId}
is set to*
, all Alibaba Cloud accounts are specified.
Resource type | ARN |
---|---|
DBInstance | acs:{#ramcode}:{#regionId}:{#accountId}:dbinstance/{#DBInstanceId} |
Condition
Redis defines the values that you can use in the
Condition
element of a policy statement. The following table describes the values. The following table describes the service-specific condition keys. The common condition keys that are defined by Alibaba Cloud also apply to Redis. For more information about the common condition keys, see Generic Condition Keyword.The data type determines the conditional operators that you can use to compare the value in a request with the value in a policy statement. You must use conditional operators that are supported by the data type. Otherwise, you cannot compare the value in the request with the value in the policy statement. In this case, the authorization is invalid. For more information about the conditional operators that are supported by each data type, see Policy elements.
Condition key | Description | Data type |
---|---|---|
kvstore:InstanceClass | String | |
kvstore:InstanceType | String | |
kvstore:SSLEnabled | String | |
kvstore:DbAudit | Boolean | |
kvstore:TDEStatus | String | |
kvstore:VpcAuthMode | String |