Creates a service-linked role.
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:
- 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 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 |
---|---|---|---|---|
ram:CreateServiceLinkedRole | Write |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ServiceName | string | Yes | The name of the service. For more information about the service name, see Alibaba Cloud services that support service-linked roles. | polardb.aliyuncs.com |
CustomSuffix | string | No | The suffix of the role name. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is | Example |
Description | string | No | The description of the service-linked role. You must configure this parameter for service-linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length. | Service Linked Role for PolarDB. PolarDB will use this role to access your resources in other services. |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"Role": {
"AssumeRolePolicyDocument": "{\\\"Statement\\\":[{\\\"Action\\\":\\\"sts:AssumeRole\\\",\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":[\\\"polardb.aliyuncs.com\\\"]}}],\\\"Version\\\":\\\"1\\\"}",
"RolePrincipalName": "AliyunServiceRoleForPolarDB@role.test.onaliyunservice.com",
"Description": "Service Linked Role for PolarDB. PolarDB will use this role to access your resources in other services.",
"RoleName": "AliyunServiceRoleForPolarDB",
"CreateDate": "2020-06-30T08:14:16Z",
"Arn": "acs:ram::177242285274****:role/aliyunserviceroleforpolardb",
"RoleId": "32833240981067****",
"IsServiceLinkedRole": true
},
"RequestId": "FE58D7CF-03BC-432A-B42D-BC3390C8C2E1"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameter.CustomSuffix.NotAllowed | Custom suffix is not allowed for this Service Linked Role. | Custom suffix is not allowed for this Service Linked Role. |
400 | InvalidParameter.CustomSuffix.InvalidChars | The parameter CustomSuffix contains invalid characters. | The parameter CustomSuffix contains invalid characters. |
400 | InvalidParameter.CustomSuffix.Length | The maximum length of the parameter CustomSuffix is exceeded. | The maximum length of the parameter CustomSuffix is exceeded. |
400 | InvalidParameter.Description.NotAllowed | Custom description is not allowed for default service linked role. | - |
400 | InvalidParameter.Description.Length | The maximum length of the description is exceeded. It must not exceed 1024 characters. | The maximum length of the description is exceeded. It must not exceed 1024 characters. |
404 | EntityNotExist.Service | The service does not exist. | The service does not exist. |
409 | EntityAlreadyExists.Role | The role already exists. | The role already exists. |
409 | LimitExceeded.Role | The maximum number of roles is exceeded. | The maximum number of roles is exceeded. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|