Creates a service-linked role.
Debugging
Authorization information
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 |
---|