全部产品
Search
文档中心

访问控制:CreateServiceLinkedRole - 创建服务关联角色

更新时间:Aug 27, 2026

调用CreateServiceLinkedRole创建服务关联角色。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称

类型

必填

描述

示例值

ServiceName

string

是

云服务名称。

具体信息,请参见支持服务关联角色的云服务的云服务标识列。

polardb.aliyuncs.com

CustomSuffix

string

否

角色名称后缀。

角色名称(含后缀)的总长度为 1~64 个字符,可包含英文字母、数字、半角句号(.)和短划线(-)。

例如:假设后缀为 Example,则角色名称为 ServiceLinkedRoleName_Example,且最大长度不能超过 64 个字符。

Example

Description

string

否

服务关联角色描述。

只有允许自定义后缀的服务关联角色才能填写角色描述,否则,角色描述将使用预设值且不能修改。

长度为 1~1024 个字符。

Service Linked Role for PolarDB. PolarDB will use this role to access your resources in other services.

返回参数

名称

类型

描述

示例值

object

返回结果。

RequestId

string

请求 ID。

FE58D7CF-03BC-432A-B42D-BC3390C8C2E1

Role

object

角色信息。

Arn

string

角色的资源描述符。

acs:ram::177242285274****:role/aliyunserviceroleforpolardb

AssumeRolePolicyDocument

string

角色的信任策略内容。

{\"Statement\":[{\"Action\":\"sts:AssumeRole\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":[\"polardb.aliyuncs.com\"]}}],\"Version\":\"1\"}

CreateDate

string

角色创建时间(UTC 时间)。

2024-06-30T08:14:16Z

Description

string

角色描述。

Service Linked Role for PolarDB. PolarDB will use this role to access your resources in other services.

IsServiceLinkedRole

boolean

是否为服务关联角色。取值:

  • true:是服务关联角色。

  • false:不是服务关联角色。

true

RoleId

string

角色 ID。

32833240981067****

RoleName

string

角色名称。

AliyunServiceRoleForPolarDB

示例

正常返回示例

JSON格式

{
  "RequestId": "FE58D7CF-03BC-432A-B42D-BC3390C8C2E1\n",
  "Role": {
    "Arn": "acs:ram::177242285274****:role/aliyunserviceroleforpolardb\n",
    "AssumeRolePolicyDocument": "{\\\"Statement\\\":[{\\\"Action\\\":\\\"sts:AssumeRole\\\",\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":[\\\"polardb.aliyuncs.com\\\"]}}],\\\"Version\\\":\\\"1\\\"}\n",
    "CreateDate": "2024-06-30T08:14:16Z\n",
    "Description": "Service Linked Role for PolarDB. PolarDB will use this role to access your resources in other services.",
    "IsServiceLinkedRole": true,
    "RoleId": "32833240981067****\n",
    "RoleName": "AliyunServiceRoleForPolarDB"
  }
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。