全部產品
Search
文件中心

Cloud Enterprise Network:CreateTransitRouterEcrAttachment

更新時間:Jul 15, 2026

您可以呼叫 CreateTransitRouterEcrAttachment 介面,將要互通的專線閘道器 ECR(ExpressConnect Router)網路執行個體連線到同地域的轉發路由器執行個體中。

介面說明

  • 僅企業版轉發路由器支援建立 ECR 連線。

  • 您可以透過以下兩種方式在企業版轉發路由器下建立 ECR 連線:

    • 如果您已經在目標地域建立了企業版轉發路由器執行個體,您可以透過指定 EcrIdRegionIdTransitRouterId 建立 ECR 連線。

    • 如果您在目標地域沒有企業版轉發路由器執行個體,您可以透過指定 EcrIdCenIdRegionId 建立 ECR 連線。建立 ECR 連線時,系統會為您自動建立企業版轉發路由器執行個體。

  • CreateTransitRouterEcrAttachment 介面屬於非同步介面,即系統會先返回一個 ECR 連線 ID,但該 ECR 連線並未建立完成,系統後台的建立任務仍在進行。您可以呼叫 ListTransitRouterEcrAttachments 介面查詢 ECR 連線的狀態。

    • 當 ECR 連線處於 Attaching 狀態時,表示 ECR 連線正在建立中,在該狀態下,您只能對 ECR 連線執行查詢操作,不能執行其他操作。

    • 當 ECR 連線處於 Attached 狀態時,表示 ECR 連線建立完成。

  • 建立 ECR 連線後,ECR 連線預設不與任何企業版轉發路由器路由表建立路由學習關係和關聯轉發關係。

    當 ECR 連線與企業版轉發路由器路由表建立路由學習關係後,系統會自動將 ECR 執行個體的路由傳播至企業版轉發路由器路由表中。

  • 建立 ECR 連線後,系統會自動將 ECR 連線關聯的企業版轉發路由器路由表中的路由傳播到 ECR 執行個體的路由表中。

前提條件

  • 企業版轉發路由器所屬的阿里雲帳號和 ECR 執行個體所屬的阿里雲帳號屬於同一家企業。

  • 企業版轉發路由器支援連線同帳號和跨帳號的 ECR 執行個體。在建立跨帳號的 ECR 連線前,請先獲得跨帳號 ECR 執行個體的授權。具體操作,請參見跨帳號網路執行個體授權

  • 呼叫本介面建立 ECR 連線前,請先呼叫 CreateExpressConnectRouterAssociation 介面為 ECR 執行個體和企業版轉發路由器執行個體建立關聯關係。

    當您呼叫 DeleteTransitRouterEcrAttachment 介面強制刪除 ECR 連線時,系統將會一併刪除 ECR 執行個體和企業版轉發路由器執行個體間的關聯關係,無需再額外刪除。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

cen:CreateTransitRouterEcrAttachment

create

*CenInstance

acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}

TransitRouter

acs:cen:*:{#accountId}:centransitrouter/{#TransitRouterId}

請求參數

名稱

類型

必填

描述

樣本值

ClientToken

string

用戶端 Token,用於保證請求的冪等性。

從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元。

說明

若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 識別碼。每次 API 請求的 RequestId 不一樣。

02fb3da4-130e-11e9-8e44-001****

CenId

string

雲端企業網執行個體 ID。

cen-7qthudw0ll6jmc****

TransitRouterId

string

轉發路由器執行個體 ID。

tr-bp1su1ytdxtataupl****

RegionId

string

轉發路由器執行個體所屬的地域 ID。

您可以透過呼叫 DescribeChildInstanceRegions 介面獲取地域 ID。

eu-central-1

TransitRouterAttachmentName

string

ECR 連線的名稱。

名稱可以為空或長度為 1~128 個字元,不能以 http:// 或 https:// 開頭。

nametest

TransitRouterAttachmentDescription

string

ECR 連線描述。

描述可以為空或長度為 1~256 個字元,不能以 http:// 或 https:// 開頭。

testdesc

EcrId

string

關聯的專線閘道器執行個體 ID。

ecr-upyc0viial107r****

EcrOwnerId

integer

ECR 執行個體所屬阿里雲帳號(主帳號)ID。預設值為目前登入的阿里雲帳號 ID。

說明

如果您要載入跨帳號的網路執行個體,本參數必填。

1250123456123456

DryRun

boolean

是否只預檢此次請求。取值:

  • true:傳送檢查請求,不會修改 VPN 連線的設定。檢查項目包括是否填寫了必需參數、請求格式、業務限制。如果檢查不通過,則返回對應錯誤。如果檢查通過,則返回錯誤碼 DryRunOperation

  • false(預設值):傳送正常請求,通過檢查後直接修改 VPN 連線的設定。

false

Tag

array<object>

標籤資訊列表。

一次最多支援輸入 20 個標籤資訊。

object

Key

string

資源的標籤鍵。

一旦傳入該值,則不允許為空字串。最多支援 64 個字元,不能以 aliyun 或者 acs: 開頭,不能包含 http:// 或者 https://

一次最多支援輸入 20 個標籤的標籤鍵。

tagtest

Value

string

資源的標籤值。

標籤值可以為空或輸入不超過 128 個字元的字串,不能以 aliyun 或者 acs: 開頭,不能包含 http:// 或者 https://

每一個標籤鍵對應一個標籤值,一次最多支援輸入 20 個標籤鍵對應的標籤值。

tagtest

返回參數

名稱

類型

描述

樣本值

object

TransitRouterAttachmentId

string

ECR 連線 ID。

tr-attach-qieks13jnt1cchy***

RequestId

string

請求 ID。

C0245BEF-52AC-44A8-A776-EF96FD26A5CA

樣本

正常返回樣本

JSON格式

{
  "TransitRouterAttachmentId": "tr-attach-qieks13jnt1cchy***",
  "RequestId": "C0245BEF-52AC-44A8-A776-EF96FD26A5CA"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 NoPermission.AliyunServiceRolePolicyForCEN You are not authorized to create the service linked role. Role Name: AliyunServiceRolePolicyForCEN. Service Name: cen.aliyuncs.com. Make sure that the user has been granted the ram:CreateServiceLinkedRole permission. 您沒有權限建立服務連結角色,角色名稱:AliyunServiceRolePolicyForCEN,服務名稱:cen.aliyuncs.com。請確保已授予目前使用者 ram:CreateServiceLinkedRole 權限。
400 OperationUnsupported.TransitRouterRegionId The specified TransitRouterRegion does not support the operation.
400 InvalidCenId.NotFound CenId is not found. 參數中指定的 CenId 不存在。
400 InvalidStatus.ResourceStatus The resource is not in a valid state for the attachment operation. 目前資源狀態不支援此操作,請稍後重試。
400 InvalidTransitRouterId.NotFound TransitRouterId is not found. 參數中指定的 TransitRouterId 不存在。
400 Forbbiden.TransitRouterServiceNotOpen The user has not open transit router service. 轉發路由器服務未開啟,請開啟後重試。
400 OperationUnsupported.TransitRouterType The specified TransitRouterType does not support the operation. 當前 TransitRouter 類型不支援該操作。
400 MissingParam.CenIdOrRegionId Either CenId or RegionId must be specified. CenId 或 RegionId 是必選參數。
400 IllegalParam.AssociateRouteTableId The specified AssociateRouteTableId is illegal. 參數中指定的 AssociateRouteTableId 不合法。
400 Forbbiden.AttachChildInstanceAcrossBid Operation is invalid, please apply for cross-bid attaching.
400 IllegalParam.RegionId RegionId is illegal. 參數中指定的 Region 無效。
400 OperationUnsupported.CenFullLevel CEN full level does not support TransitRouter Full 模式的 CEN 不支援 VPN Bpg。
400 InvalidOperation.CenInstanceStatus The CEN instance is not in a valid state for the operation.
400 IncorrectStatus.TransitRouter The status of TransitRouter is incorrect. 目前 TR 的狀態不支援此操作,請稍後重試。
400 QuotaFull.ChildInstanceRelatedCen The childinstance has exceed the quota of the times that a childinstance can be attached as an attachment. 該執行個體綁定 CEN 數量已達到上限,無法載入。
400 Forbidden.ResourceOwnerTransitRouterServiceNotOpen The resource owner user has not opened transit router service. 資源所屬帳號轉發路由器服務未開通,請通知對方開通後重試。
400 OperationUnsupported.BandwidthType The specified BandwidthType does not support the operation. 目前的 BandwidthType 不支援此操作。
400 IllegalParam.BandwidthType BandwidthType is illegal. 頻寬套件類型不合法。
400 IncorrectStatus.EcrResource The ECR resource is not in a valid state for the attachment operation. ECR 資源狀態非法。
400 QuotaExceeded.CenQuotaEcrAttachPerTransitRouter The maximum number of ECR attachment per Transit Router is exceeded. 轉發路由器下的 ECR 連線數量超限。
400 OperationUnsupported.ECRAttachment ECR Attachment is not supported. 不支援 ECR Attachment。
400 InvalidTransitRouterMode.NeedUpgrade TransitRouter need to upgrade. 目前轉發路由器模式不支援。
400 ResourceNotFound The resource does not found. 資源不存在。
400 Forbidden.ResourceOwnerTransitRouterServiceExpired The transit router service of the account to which the resource belongs has been suspended due to arrears. Please notify the other party to renew the service and try again. 資源所屬帳號的轉發路由器服務已欠費停服,請通知對方續費後重試。
400 Forbidden.TransitRouterServiceExpired The transit router service is out of service. 轉發路由器服務已欠費停服,請續費後重試。
400 Forbbiden.AttachAcrossBidEcr Attach cross bid ECR is unsupported. Please submit a ticket. 不允許綁定不同 Bid 帳號下的 ECR,請提交工單申請。
400 InvalidParameter Invalid parameter. 參數不合法。
400 Unauthorized The AccessKeyId is unauthorized. 帳號無權限操作。
400 InvalidParameter.ResourceType The specified parameter ResourceType is invalid.
400 SystemBusy The system is busy. Please try again later. 目前系統繁忙,請稍後重試。
400 OperationDenied.AttachmentInCurrentRegionExisted The current operation is rejected. The Express Connect Router instance can only associate one Transit Router in the same region.
400 InvalidParameter.TagValue The specified parameter TagValue is invalid. 輸入的參數 Tag Value 不合法。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情