Attaches an IPsec-VPN connection to a transit router.
Operation description
- By default, route learning and associated forwarding are disabled between transit router route tables and IPsec-VPN attachments.
- When you call
CreateTransitRouterVpnAttachment
, if you set CenId and RegionId, you do not need to set TransitRouterId. If you set TransitRouterId and RegionId, you do not need to set CenId.
Prerequisites
- Before you attach an IPsec-VPN connection to a transit router, make sure that at least one IPsec-VPN connection is created in the region where the transit router is deployed. Make sure the IPsec-VPN connection is not associated with a resource. For more information, see CreateVpnAttachment .
- If the IPsec-VPN connection to be attached to the transit router belongs to a different Alibaba Cloud account, make sure that the transit router has obtained the required permissions from the IPsec-VPN connection. For more information, see GrantInstanceToTransitRouter .
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cen:CreateTransitRouterVpnAttachment | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among all requests. The token can contain only ASCII characters. Note
If you do not set this parameter, ClientToken is set to the value of RequestId. The value of RequestId for each API request may be different.
| 123e4567-e89b-12d3-a456-42665544**** |
DryRun | boolean | No | Specifies whether to perform a dry run. Valid values:
| false |
CenId | string | No | The ID of the Cloud Enterprise Network (CEN) instance. | cen-rsgxs8ng2awen2**** |
TransitRouterId | string | No | The ID of the transit router. | tr-p0wm740vjnbaprv0m**** |
RegionId | string | No | The ID of the region where the transit router is deployed. You can call the DescribeChildInstanceRegions operation to query the most recent region list. | cn-hangzhou |
TransitRouterAttachmentName | string | No | The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter. | nametest |
TransitRouterAttachmentDescription | string | No | The description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with | desctest |
VpnId | string | Yes | The ID of the IPsec-VPN attachment. | vco-p0w042cqwvlhl4zyw**** |
VpnOwnerId | long | No | The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.
| 1210123456123456 |
AutoPublishRouteEnabled | boolean | No | Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
| true |
ChargeType | string | No | The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method. | POSTPAY |
Zone | array<object> | Yes | The ID of the zone in the current region. Resources are deployed in the specified zone. | |
object | Yes | The ID of the zone where the instance resides. | ||
ZoneId | string | Yes | The zone ID of the read-only instance. You can call the ListTransitRouterAvailableResource operation to query the most recent zone list. | cn-hangzhou-h |
Tag | array<object> | No | The tags. You can specify at most 20 tags in each call. | |
object | No | The information about the tags. | ||
Key | string | No | The tag key. The tag keys cannot be an empty string. The tag key can be up to 64 characters in length, and cannot start with You can specify at most 20 tag keys. | TagKey |
Value | string | No | The tag value. The tag value can be 0 to 128 characters in length, and cannot start with Each tag key must have a unique tag value. You can specify at most 20 tag values in each call. | TagValue |
Response parameters
Examples
Sample success responses
JSON
format
{
"TransitRouterAttachmentId": "tr-attach-y5dup2qwfyh9lu****",
"RequestId": "8B5DD40A-3A29-5AC0-B8DA-05FD10D5C893"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
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. | The error message returned because you do not have the permissions to create the service-linked role whose role name is AliyunServiceRolePolicyForCEN and service name is cen.aliyuncs.com. You must acquire the ram:CreateServiceLinkedRole permission before you can create the service-linked role. |
400 | OperationUnsupported.TransitRouterRegionId | The specified TransitRouterRegion does not support the operation. | - |
400 | InvalidCenId.NotFound | CenId is not found. | The error message returned because the specified CEN instance does not exist. |
400 | InvalidStatus.ResourceStatus | The resource is not in a valid state for the attachment operation. | The error message returned because the status of the specified resource does not support this operation. Try again later. |
400 | InvalidTransitRouterId.NotFound | TransitRouterId is not found. | The error message returned because the ID of the transit router does not exist. |
400 | Forbbiden.TransitRouterServiceNotOpen | The user has not open transit router service. | The error message returned because the transit router is disabled. Enable the transit router and try again. |
400 | InvalidTransitRouterMode.NeedUpgrade | TransitRouter need to upgrade. | The error message returned because the specified transit router mode is not supported. |
400 | InvalidAvailable.NoResource | No resource in the available zone. | The error message returned because resources are insufficient in the specified region. |
400 | OperationUnsupported.VpnAttachment | The specified region does not support the operation. | The error message returned because this operation is not supported in the specified region. |
400 | OperationUnsupported.TransitRouterType | The specified TransitRouterType does not support the operation. | The error message returned because this operation is not supported by the specified type of transit router. |
400 | OperationFailed.AllocateCidrFailed | Operation failed because vpn allocate cidr failed. | The error message returned because the VPN failed to apply for a CIDR block. |
400 | OperationUnsupported.ZoneId | The specified ZoneId does not support the operation. | - |
400 | MissingParam.CenIdOrRegionId | Either CenId or RegionId must be specified. | The error message returned because the CenId or RegionId parameter is not set. |
400 | IllegalParam.RegionId | RegionId is illegal. | The error message returned because the specified region is invalid. |
400 | OperationUnsupported.CenFullLevel | CEN full level does not support TransitRouter | The error message returned because CEN instances of the Full type do not support Enterprise Edition transit routers. |
400 | InvalidOperation.CenInstanceStatus | The CEN instance is not in a valid state for the operation. | - |
400 | IllegalParam.ZoneMappings | The Specified Parameter ZoneMappings is illegal | The error message returned because the specified zone mappings (ZoneMappings) is invalid. |
400 | IncorrectStatus.TransitRouter | The status of TransitRouter is incorrect. | The error message returned because the status of the transit router does not support this operation. Try again later. |
400 | InvalidOperation.VpnNetworkTypeInvalid | The network type of child-instance is invalid. | The error message returned because the network type specified for the instance is invalid. |
400 | QuotaExceeded.CenQuotaVpnAttachPerTransitRouter | The maximum number of VPN attachment per Transit Router is exceeded. | The error message returned because specified number of VPN attachments to the transit router exceeds the upper limit. You can submit a ticket to request a quota increase. |
400 | QuotaFull.ChildInstanceRelatedCen | The childinstance has exceed the quota of the times that a childinstance can be attached as an attachment. | The error message returned because the number of CEN instances to which the instance is attached has reached the upper limit. You cannot attach the instance to more CEN instances. |
400 | Forbidden.ResourceOwnerTransitRouterServiceNotOpen | The resource owner user has not opened transit router service. | The transit router service for the resource owner's account is not currently opened. Please inform them to open the transit router service and then try again. |
400 | InvalidParameter | Invalid parameter. | The error message returned because the parameter is set to an invalid value. |
400 | Unauthorized | The AccessKeyId is unauthorized. | The error message returned because you do not have the permissions to perform this operation. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-01-04 | The Error code has changed | View Change Details |
2022-12-22 | The Error code has changed | View Change Details |