CreateTransitRouterVpcAttachment API を呼び出して、VPC をトランジットルーターにアタッチします。接続後、トランジットルーターによるプライベートネットワーク通信が可能になります。
操作説明
-
Enterprise Edition トランジットルーターの VPC 接続は、次の 2 つの方法のいずれかで作成できます。
対象リージョンに Enterprise Edition トランジットルーターインスタンスが既にある場合は、VpcId、ZoneMappings.N.VSwitchId、ZoneMappings.N.ZoneId、TransitRouterId、および RegionId を指定して VPC 接続を作成できます。
対象リージョンに Enterprise Edition トランジットルーターインスタンスがない場合は、VpcId、ZoneMappings.N.VSwitchId、ZoneMappings.N.ZoneId、CenId、および RegionId を指定して VPC 接続を作成できます。VPC 接続の作成時に、システムが自動的に Enterprise Edition トランジットルーターインスタンスを作成します。
-
CreateTransitRouterVpcAttachment は非同期 API です。リクエストを送信すると、システムは VPC 接続 ID を返し、接続はバックグラウンドで作成されます。VPC 接続のステータスを確認するには、ListTransitRouterVpcAttachments API を呼び出してください。
「アタッチ中」ステータスは、VPC 接続が作成中であることを示します。このステータスでは、VPC 接続の照会のみ可能です。
「アタッチ済み」ステータスは、VPC 接続が作成されたことを示します。
-
デフォルトでは、新規作成された VPC 接続は、ルート学習または転送用のトランジットルーターのルートテーブルに関連付けられていません。
前提条件
この API を呼び出して VPC 接続を作成する前に、次の前提条件が満たされていることを確認してください。
VPC インスタンスは、Enterprise Edition トランジットルーターをサポートするアベイラビリティーゾーンに、少なくとも 1 つの vSwitch を持つ必要があります。vSwitch には、少なくとも 1 つの利用可能な IP アドレスが必要です。サポートされているリージョンとアベイラビリティーゾーンの詳細については、「Enterprise Edition トランジットルーターをサポートするリージョンとゾーン」をご参照ください。
クロスアカウントのネットワークインスタンスを接続するには、まず必要な権限を取得する必要があります。詳細については、「別のアカウントに属するネットワークインスタンスに権限を付与する」をご参照ください。
VPC 接続の作成には料金が発生します。課金ルールを理解していることを確認してください。詳細については、「課金」をご参照ください。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
cen:CreateTransitRouterVpcAttachment |
create |
CenInstance
TransitRouter
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| ClientToken |
string |
任意 |
リクエストのべき等性を保証するために使用されるクライアントトークンです。 クライアント側で、リクエストごとに一意の値を生成する必要があります。トークンには ASCII 文字のみを含めることができます。 説明
このパラメーターを指定しない場合、システムは自動的にリクエスト ID をクライアントトークンとして使用します。リクエスト ID はリクエストごとに一意です。 |
02fb3da4-130e-11e9-8e44-001**** |
| CenId |
string |
任意 |
CEN インスタンスの ID です。 |
cen-j3jzhw1zpau2km**** |
| TransitRouterId |
string |
任意 |
エンタープライズ版トランジットルーターインスタンスの ID です。 |
tr-bp1su1ytdxtataupl**** |
| RegionId |
string |
任意 |
VPC が属するリージョンの ID です。 DescribeChildInstanceRegions API を呼び出してリージョン ID を取得できます。 |
cn-hangzhou |
| TransitRouterAttachmentName |
string |
任意 |
VPC アタッチメントの名前です。 名前は空、または 1~128 文字で、 |
testname |
| TransitRouterAttachmentDescription |
string |
任意 |
VPC アタッチメントの説明です。 説明は空、または 1~256 文字で、 |
testname |
| VpcId |
string |
必須 |
VPC インスタンスの ID です。 |
vpc-bp1kbjcre9vtsebo1**** |
| VpcOwnerId |
integer |
任意 |
VPC インスタンスを所有する Alibaba Cloud アカウント (ルートアカウント) の ID です。デフォルトでは、現在の Alibaba Cloud アカウントの ID です。 説明
クロスアカウントのネットワークインスタンスをアタッチする場合、このパラメーターは必須です。 |
1250123456123456 |
| ChargeType |
string |
任意 |
課金方法です。デフォルト値は POSTPAY (従量課金) です。 |
POSTPAY |
| DryRun |
boolean |
任意 |
リソースを作成せずにリクエストの有効性を確認するためのドライランを実行するかどうかを指定します。このチェックには、権限とインスタンスのステータスが含まれます。有効な値:
|
false |
| ZoneMappings |
array<object> |
必須 |
VPC アタッチメントのゾーンマッピングです。各マッピングでは、エンタープライズ版トランジットルーターでサポートされているアベイラビリティーゾーン内の vSwitch を指定します。 最大 10 個のゾーンマッピングを指定できます。 |
|
|
object |
任意 |
vSwitch とアベイラビリティーゾーン間のマッピングです。 |
||
| VSwitchId |
string |
必須 |
vSwitch の ID です。 |
vsw-bp1a214sbus8z3b54**** |
| ZoneId |
string |
必須 |
アベイラビリティーゾーンの ID です。アベイラビリティーゾーンは、エンタープライズ版トランジットルーターでサポートされている必要があります。 DescribeZones API を呼び出して、利用可能なゾーンを照会できます。 |
cn-hangzhou-h |
| AutoPublishRouteEnabled |
boolean |
任意 |
エンタープライズ版トランジットルーターが VPC インスタンスにルートを自動的に広報できるようにするかどうかを指定します。
|
true |
| TransitRouterVPCAttachmentOptions |
object |
任意 |
VPC アタッチメントのプロパティです。このパラメーターは非推奨です。代わりに |
|
|
string |
任意 |
VPC アタッチメントのプロパティです。このパラメーターは非推奨です。代わりに ipv6Support: IPv6 を有効にするかどうかを指定します。有効な値:
説明
VPC アタッチメントで IPv6 を有効にする前に、VPC とそれに関連付けられた vSwitch でも IPv6 が有効になっていることを確認してください。詳細については、「AllocateVpcIpv6Cidr」および「CreateVSwitchCidrReservation」をご参照ください。 |
disable |
|
| Tag |
array<object> |
任意 |
VPC アタッチメントに追加するタグです。 最大 20 個のタグを追加できます。 |
|
|
object |
任意 |
タグのキーと値です。 |
||
| Key |
string |
任意 |
タグのキーです。 タグキーは空の文字列にできません。キーの長さは最大 64 文字で、 |
tagtest |
| Value |
string |
任意 |
タグの値です。 タグ値は、空の文字列または 128 文字以内の文字列にすることができます。先頭に |
tagtest |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
レスポンスデータです。 |
||
| TransitRouterAttachmentId |
string |
VPC 接続の ID です。 |
tr-attach-ia340z7xis7t5s**** |
| RequestId |
string |
リクエスト ID です。 |
C087A369-82B9-43EF-91F4-4B63A9C6E6B6 |
例
成功レスポンス
JSONJSON
{
"TransitRouterAttachmentId": "tr-attach-ia340z7xis7t5s****",
"RequestId": "C087A369-82B9-43EF-91F4-4B63A9C6E6B6"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | OperationUnsupported.TransitRouterRegionId | The specified TransitRouterRegion does not support the operation. | |
| 400 | NoPermission.AliyunServiceRoleForCEN | You are not authorized to create the service linked role. Role Name: AliyunServiceRoleForCEN. Service Name: cen.aliyuncs.com. Make sure that the user has been granted the ram:CreateServiceLinkedRole permission. | |
| 400 | IllegalParam.RegionId | The Specified Parameter RegionId is illegal | |
| 400 | MissingParam.CenIdOrRegionId | Either CenId or RegionId must be specified. | |
| 400 | IllegalParam.ZoneId | The specified ZoneId is illegal. | |
| 400 | IllegalParam.ChargeType | The specified ChargeType is illegal. | |
| 400 | InvalidTransitRouterId.NotFound | The specified TransitRouterId is not found. | |
| 400 | IncorrectStatus.VpcResource | The resource is not in a valid state for the attachment operation. | |
| 400 | IncorrectStatus.Vpc | The resource is not in a valid state for the attachment operation. | |
| 400 | IncorrectStatus.VpcOrVswitch | The Vpc Or Vswith is not in a valid state for the attachment operation. | |
| 400 | OperationNotSupport.VpcAutoRoutesPublish | Auto publish vpc routes is not supported in this region. | |
| 400 | InvalidOperation.VpnAssociated | The operation is not supported because the VPC is associated with VPN. | |
| 400 | Forbbiden.TransitRouterServiceNotOpen | The user has not open transit router service. | |
| 400 | IllegalParam.ZoneMappings | The Specified Parameter ZoneMappings is illegal | |
| 400 | OperationUnsupported.TransitRouterType | The specified TransitRouterType does not support the operation. | |
| 400 | InvalidCenId.NotFound | CenId is not found. | |
| 400 | IllegalParam.VSwitchId | VSwitchId is illegal. | |
| 400 | IncorrectStatus.TransitRouterInstance | The status of TransitRouter is incorrect. | |
| 400 | OperationUnsupported.CenFullLevel | CEN full level does not support TransitRouter | |
| 400 | IllegalParam.ServiceMode | ServiceMode is illegal. | |
| 400 | QuotaFull.ChildInstanceRelatedCen | The childinstance has exceed the quota of the times that a childinstance can be attached as an attachment. | |
| 400 | OperationUnsupported.CloudBoxVswNotSupport | Cloud Box vsw does not support. | |
| 400 | IncorrectStatus.TransitRouter | The status of TransitRouter is incorrect. | |
| 400 | Duplicated.ZoneMapping | The parameter ZoneMapping is duplicated. | |
| 400 | QuotaExceeded.CenQuotaVpcAttachPerTransitRouter | The maximum number of VPC attachment per Transit Router is exceeded. | |
| 400 | IncorrectStatus.VpcRouteTable | The VPC route table is not in a desired state. | |
| 400 | InvalidStatus.VpcAttachedFullModeCen | The VPC has been attached to another CEN instance whose protection level is FULL. | |
| 400 | Forbbiden.AttachChildInstanceAcrossBid | VPCs that belong to another BID cannot be associated. You need to apply for cross-BID attaching. | |
| 400 | InvalidOperation.VpcAutoRoutesPublishInOtherCEN | The specified VPC already has its routes synchronized with another CEN instance. | |
| 400 | QuotaExceeded.VpcAutoRoutesPublishPerTransitRouter | The number of VPCs that have route synchronization enabled has reached the upper limit. | |
| 400 | InsufficientIpAddr.vsw | Insufficient available IP addresses in the vSwitch. | |
| 400 | Forbidden.ResourceOwnerTransitRouterServiceNotOpen | The resource owner user has not opened transit router service. | |
| 400 | IllegalParam.TransitRouterRegionId | TransitRouterRegionId is illegal. | |
| 400 | InvalidTransitRouterMode.NeedUpgrade | TransitRouter need to upgrade. | |
| 400 | IllegalParam.Ipv6Support | Ipv6Support is illegal. Valid Values are [enable, disable]. | |
| 400 | OperationFailed.VSwitchNotFound | The specified vswitch not found. | |
| 400 | OperationFailed.VSwitchIpv6CidrNotAllocated | The specified vswitch does not have IPv6 address allocated. | |
| 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 | InvalidParameter.ResourceType | The specified parameter ResourceType is invalid. | |
| 400 | ParamExclusive.TransitRouterVPCAttachmentOptionsAndOptions | When creating or modifying a VPC attachment, the input parameter TransitRouterVPCAttachmentOptions and Options cannot be used at the same time. | |
| 400 | InvalidParameter.ApplianceModeSupport | The specified parameter ApplianceModeSupport is invalid. | |
| 400 | InvalidParameter.Ipv6Support | The specified parameter Ipv6Support is invalid. | |
| 400 | INVALID_OPERATION_RESOURCE_NOT_SUPPORT_APPLIANCE_MODE | Only VPC attachment support appliance mode. | |
| 404 | InvalidVSwitchId.NotFound | The specified VSwitchId is not found. | |
| 409 | InvalidOperation.CenInstanceStatus | The CEN instance is not in a valid state for the operation. | |
| 409 | IncorrectStatus.VpcSwitch | The resource is not in a valid state for the attachment operation. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。