トランジットルーターは IPsec 接続をサポートしており、データセンターをトランジットルーターに接続して他のネットワークと通信できます。CreateTransitRouterVpnAttachment 操作を呼び出して VPN 接続を作成できます。
操作説明
VPN 接続を作成した後、デフォルトでは、接続はトランジットルーターのどのルートテーブルからもルートを学習したり、関連付けられたりしません。
CreateTransitRouterVpnAttachment操作を呼び出す際、CenId と RegionId を指定する場合、TransitRouterId を指定する必要はありません。TransitRouterId と RegionId を指定する場合、CenId を指定する必要はありません。
前提条件
VPN 接続を作成する前に、トランジットルーターインスタンスと同じリージョンに IPsec 接続を作成し、その IPsec 接続がどのリソースにもアタッチされていないことを確認してください。詳細については、「CreateVpnAttachment」をご参照ください。
トランジットルーターインスタンスがクロスアカウントの IPsec 接続に接続する必要がある場合は、トランジットルーターインスタンスに IPsec 接続に対する必要な権限が付与されていることを確認してください。詳細については、「GrantInstanceToTransitRouter」をご参照ください。
VPN 接続を作成する前に、トランジットルーターに CIDR ブロックを設定していることを確認してください。詳細については、「CreateTransitRouterCidr」をご参照ください。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
cen:CreateTransitRouterVpnAttachment |
create |
CenInstance
TransitRouter
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| ClientToken |
string |
任意 |
リクエストのべき等性を保証するために使用されるクライアントトークンです。 クライアントで一意のトークンを生成します。トークンには ASCII 文字のみを含めることができます。 説明
このパラメーターを指定しない場合、システムは自動的に RequestId を ClientToken として使用します。各 API リクエストの RequestId は異なる場合があります。 |
123e4567-e89b-12d3-a456-42665544**** |
| DryRun |
boolean |
任意 |
ドライランを実行するかどうかを指定します。有効な値:
|
false |
| CenId |
string |
任意 |
Cloud Enterprise Network (CEN) インスタンスの ID。 |
cen-rsgxs8ng2awen2**** |
| TransitRouterId |
string |
任意 |
トランジットルーターインスタンスの ID。 |
tr-p0wm740vjnbaprv0m**** |
| RegionId |
string |
任意 |
トランジットルーターインスタンスがデプロイされているリージョンの ID。 DescribeChildInstanceRegions 操作を呼び出して、最新のリージョンリストをクエリできます。 |
cn-hangzhou |
| TransitRouterAttachmentName |
string |
任意 |
VPN 接続の名前。 名前は空または 1~128 文字の長さで、`http://` または `https://` で始めることはできません。 |
nametest |
| TransitRouterAttachmentDescription |
string |
任意 |
VPN 接続の説明。 説明は空または 1~256 文字の長さで、`http://` または `https://` で始めることはできません。 |
desctest |
| VpnId |
string |
必須 |
IPsec 接続の ID。 |
vco-p0w042cqwvlhl4zyw**** |
| VpnOwnerId |
integer |
任意 |
IPsec 接続が属する Alibaba Cloud アカウントの ID。
|
1210123456123456 |
| AutoPublishRouteEnabled |
boolean |
任意 |
トランジットルーターが IPsec 接続にルートを自動的に発行できるようにするかどうかを指定します。有効な値:
|
true |
| ChargeType |
string |
任意 |
課金方法。 値は POSTPAY (デフォルト) に設定され、従量課金方法を指定します。 |
POSTPAY |
| Zone |
array<object> |
任意 |
現在のリージョン内のゾーンの ID。 システムは指定されたゾーンにリソースを作成します。 説明
アタッチされた IPsec 接続がデュアルトンネルモードの場合は、このパラメーターを指定しないでください。 |
|
|
object |
任意 |
ゾーン ID。 |
||
| ZoneId |
string |
任意 |
ゾーン ID。 ListTransitRouterAvailableResource 操作を呼び出して、利用可能なゾーンをクエリできます。 |
cn-hangzhou-h |
| Tag |
array<object> |
任意 |
タグ。 最大 20 個のタグを指定できます。 |
|
|
object |
任意 |
タグ。 |
||
| Key |
string |
任意 |
タグキー。 タグキーは空の文字列にすることはできません。長さは最大 64 文字です。 最大 20 個のタグキーを指定できます。 |
TagKey |
| Value |
string |
任意 |
タグ値。 タグ値は空の文字列または最大 128 文字の文字列にすることができます。 最大 20 個のタグ値を指定できます。 |
TagValue |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
応答。 |
||
| TransitRouterAttachmentId |
string |
VPN 接続の ID。 |
tr-attach-y5dup2qwfyh9lu**** |
| RequestId |
string |
リクエスト ID。 |
8B5DD40A-3A29-5AC0-B8DA-05FD10D5C893 |
例
成功レスポンス
JSONJSON
{
"TransitRouterAttachmentId": "tr-attach-y5dup2qwfyh9lu****",
"RequestId": "8B5DD40A-3A29-5AC0-B8DA-05FD10D5C893"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 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. | |
| 400 | OperationUnsupported.TransitRouterRegionId | The specified TransitRouterRegion does not support the operation. | |
| 400 | InvalidCenId.NotFound | CenId is not found. | |
| 400 | InvalidStatus.ResourceStatus | The resource is not in a valid state for the attachment operation. | |
| 400 | InvalidTransitRouterId.NotFound | TransitRouterId is not found. | |
| 400 | Forbbiden.TransitRouterServiceNotOpen | The user has not open transit router service. | |
| 400 | InvalidTransitRouterMode.NeedUpgrade | TransitRouter need to upgrade. | |
| 400 | InvalidAvailable.NoResource | No resource in the available zone. | |
| 400 | OperationUnsupported.VpnAttachment | The specified region does not support the operation. | |
| 400 | OperationUnsupported.TransitRouterType | The specified TransitRouterType does not support the operation. | |
| 400 | OperationFailed.AllocateCidrFailed | Operation failed because vpn allocate cidr failed. | |
| 400 | OperationUnsupported.ZoneId | The specified ZoneId does not support the operation. | |
| 400 | MissingParam.CenIdOrRegionId | Either CenId or RegionId must be specified. | |
| 400 | IllegalParam.RegionId | RegionId is illegal. | |
| 400 | OperationUnsupported.CenFullLevel | CEN full level does not support TransitRouter | |
| 400 | InvalidOperation.CenInstanceStatus | The CEN instance is not in a valid state for the operation. | |
| 400 | IllegalParam.ZoneMappings | The Specified Parameter ZoneMappings is illegal | |
| 400 | IncorrectStatus.TransitRouter | The status of TransitRouter is incorrect. | |
| 400 | InvalidOperation.VpnNetworkTypeInvalid | The network type of child-instance is invalid. | |
| 400 | QuotaExceeded.CenQuotaVpnAttachPerTransitRouter | The maximum number of VPN attachment per Transit Router is exceeded. | |
| 400 | QuotaFull.ChildInstanceRelatedCen | The childinstance has exceed the quota of the times that a childinstance can be attached as an attachment. | |
| 400 | Forbidden.ResourceOwnerTransitRouterServiceNotOpen | The resource owner user has not opened transit router service. | |
| 400 | OperationUnsupported.VcoTunnelNotMatchZoneParam | The tunnel type of the entered Vco does not match the Zone parameter. | |
| 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 | InvalidParameter | Invalid parameter. | |
| 400 | Unauthorized | The AccessKeyId is unauthorized. | |
| 400 | IllegalParam.TransitRouterRegionId | TransitRouterRegionId is illegal. | |
| 400 | InvalidVpnId.NotFound | The specified vpn connection instance id does not exist. | |
| 400 | InvalidParameter.ResourceType | The specified parameter ResourceType is invalid. | |
| 400 | InvalidParameter.VpnId | The specified parameter VpnId is invalid. | |
| 400 | IllegalParam.ChargeType | The specified ChargeType is illegal. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。