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

Resource Management:CreateServiceLinkedRole

最終更新日:Oct 27, 2026

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

今すぐお試しください

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

テスト

RAM 認証

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

リクエストパラメーター

パラメーター

型

必須 / 任意

説明

例

ServiceName

string

必須

サービス名。詳細については、「サービスリンクロールをサポートするクラウドサービス」を参照してください。

polardb.aliyuncs.com

CustomSuffix

string

任意

サービスリンクロールのロール名のサフィックス。サフィックスを含むロール名の全長は 1~64 文字で、英字、数字、ピリオド (.)、ハイフン (-) を使用できます。たとえば、サフィックスが Example の場合、ロール名は ServiceLinkedRoleName_Example となり、長さの最大値は 64 文字です。

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

ロールのリソース記述子。

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****:ロール/aliyunserviceroleforpolardb",
    "AssumeRolePolicyDocument": "{\\\"Statement\\\":[{\\\"Action\\\":\\\"sts:AssumeRole\\\",\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"サービス\\\":[\\\"polardb.aliyuncs.com\\\"]}}],\\\"Version\\\":\\\"1\\\"}",
    "CreateDate": "2020-06-30T08:14:16Z",
    "Description": "PolarDB 用のサービスリンクロール。PolarDB はこのロールを使用して、他のサービス内のリソースにアクセスします",
    "IsServiceLinkedRole": true,
    "RoleId": "32833240981067****",
    "RoleName": "AliyunサービスRoleForPolarDB",
    "RolePrincipalName": "AliyunサービスRoleForPolarDB@ロール.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. CustomSuffix パラメーターに無効な文字が含まれています。
400 InvalidParameter.CustomSuffix.Length The maximum length of the parameter CustomSuffix is exceeded. CustomSuffix パラメーターの長さが制限を超えています。
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.

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

変更履歴

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