すべてのプロダクト
Search
ドキュメントセンター

Resource Management:CreateServiceLinkedRole

最終更新日:Mar 31, 2026

サービスリンクロールを作成します。

今すぐお試しください

この API を OpenAPI Explorer でお試しください。手作業による署名は必要ありません。呼び出しに成功すると、入力したパラメーターに基づき、資格情報が組み込まれた SDK コードが自動的に生成されます。このコードをダウンロードしてローカルで使用できます。

テスト

RAM 認証

この操作の認証情報はありません。問題が発生した場合は、アカウントマネージャーにご連絡ください。

リクエストパラメーター

パラメーター

必須 / 任意

説明

ServiceName

string

必須

サービス名。

サービス名の詳細については、「サービスリンクロールをサポートする Alibaba Cloud サービス」をご参照ください。

polardb.aliyuncs.com

CustomSuffix

string

任意

ロール名のサフィックス。

ロール名 (サフィックスを含む) は、1 文字から 64 文字の長さで、文字、数字、ピリオド (.)、およびハイフン (-) を含めることができます。

たとえば、サフィックスが Example の場合、ロール名は ServiceLinkedRoleName_Example です。

Example

Description

string

任意

サービスリンクロールの説明。

カスタムサフィックスをサポートするサービスリンクロールの場合、このパラメーターを設定する必要があります。それ以外の場合、デフォルト値が使用され、変更できません。

説明は 1 文字から 1,024 文字の長さである必要があります。

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

ロールの Alibaba Cloud リソース名 (ARN)。

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

AssumeRolePolicyDocument

string

ロールの信頼ポリシーのドキュメント。

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

CreateDate

string

ロールが作成された時間。時間は協定世界時 (UTC) で表示されます。

2020-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

RolePrincipalName

string

ドメイン名をサフィックスとして使用するロール名。

AliyunServiceRoleForPolarDB@role.test.onaliyunservice.com

成功レスポンス

JSONJSON

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

エラーコード

HTTP ステータスコード

エラーコード

エラーメッセージ

説明

400 InvalidParameter.CustomSuffix.NotAllowed Custom suffix is not allowed for this Service Linked Role.
400 InvalidParameter.CustomSuffix.InvalidChars The parameter CustomSuffix contains invalid characters.
400 InvalidParameter.CustomSuffix.Length 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.
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.

完全なリストについては、「エラーコード」をご参照ください。

変更履歴

完全なリストについては、「変更履歴」をご参照ください。