RAM authorization for ApsaraMQ for Kafka
Resource Access Management (RAM) controls access to your Alibaba Cloud resources. Instead of sharing your Alibaba Cloud account AccessKey pair, create RAM users and grant them only the permissions they need.
ApsaraMQ for Kafka defines the following actions and resources for RAM policies. Use these elements to build custom policies and attach them to RAM users or RAM roles.
RAM code:
alikafkaPermission granularity: Resource level
Policy structure
A RAM policy is a JSON document with the following structure:
{
"Version": "1",
"Statement": [
{
"Effect": "<Effect>",
"Action": "<Action>",
"Resource": "<Resource>",
"Condition": {
"<Condition_operator>": {
"<Condition_key>": [
"<Condition_value>"
]
}
}
}
]
}Field | Description |
Effect | Allows or denies access. Valid values: |
Action | One or more operations to allow or deny. See Actions. |
Resource | One or more resources specified by Alibaba Cloud Resource Name (ARN). See Resources. |
Actions
The following tables map RAM actions to API operations. Use these values in the Action element of your policy.
Column descriptions:
Action: The permission string to use in your policy.
API operation: The API operation that this action authorizes.
Access level: The type of access granted:
create,get,update, ordelete.Resource type: The required resource type. Bold text indicates a required type. All resources means resource-level permissions are not supported for this action.
Associated operation: Other actions required to complete the operation.
Instance management
Action | API operation | Access level | Resource type | Condition key | Associated operation |
alikafka:CreatePrePayOrder | create | Instance | alikafka:SpecType, alikafka:DeployModule | None | |
alikafka:StartInstance | update | All resources | alikafka:DeployModule, alikafka:SpecType, alikafka:Acl, alikafka:DiskEncryption | None | |
alikafka:UpdateInstance | update | Instance | None | None | |
alikafka:ListInstance | get | All resources | None | None | |
alikafka:ListInstance | get | All resources | None | None | |
alikafka:UpgradePostPayOrder | update | All resources | alikafka:DeployModule | None |
Tag operations
Action | API operation | Access level | Resource type | Condition key | Associated operation |
alikafka:ListTagResources | get | All resources | None | None | |
alikafka:UntagResources | update | All resources | None | None | |
alikafka:TagResources | update | Instance | None | None |
SASL user management
Action | API operation | Access level | Resource type | Condition key | Associated operation |
alikafka:CreateSaslUser | create | Instance | None | None | |
alikafka:DeleteSaslUser | delete | Instance | None | None | |
alikafka:ListSaslUser | get | Instance | None | None |
Resources
Specify resources in the Resource element of your policy using Alibaba Cloud Resource Names (ARNs). The following table lists the ARN formats that ApsaraMQ for Kafka supports.
Replace {#} placeholders with actual values. An asterisk (*) matches all values for a given segment:
{#resourceType}=*matches all resources.{#regionId}=*matches all regions.{#accountId}=*matches all Alibaba Cloud accounts.
ARN formats by resource type
The following table lists the ARN format that ApsaraMQ for Kafka (Confluent Edition) supports.
Resource type | ARN format |
Instance |
|
Tip: To grant access to a single instance, specify its instance ID in the ARN rather than using a wildcard. Use resource-level ARNs instead of * whenever possible.
What to do next
Create a custom policy, and then attach it to a RAM user, RAM user group, or RAM role: