CreateServiceLinkedRole - 创建服务关联角色

更新时间:
复制 MD 格式

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

调试

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

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

ram:CreateServiceLinkedRole

create

*全部资源

*

  • ram:ServiceName
无

请求参数

名称

类型

必填

描述

示例值

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"
  }
}

错误码

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

变更历史

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