Creates a VPN gateway.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateVpnGateway

The operation that you want to perform. Set the value to CreateVpnGateway.

Bandwidth Integer Yes 5

The Internet bandwidth limit of the VPN gateway. Unit: Mbit/s.

Valid values: 5, 10, 20, 50, 100 and 200.

RegionId String Yes cn-hangzhou

The ID of the region where the VPN gateway is created. You can call the DescribeRegions operation to query region IDs.

VpcId String Yes vpc-bp1ub1yt9cvakoelj****

The ID of the virtual private cloud (VPC) where the VPN gateway is deployed.

Name String No MYVPN

The name of the VPN gateway. The default value is the ID of the VPN gateway.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://.

InstanceChargeType String No The Alibaba Cloud China site: PREPAY. The Alibaba Cloud International site: POSTPAY.

Select a billing method for the VPN gateway. Set the value to POSTPAY: pay-as-you-go.

Note This parameter is required when you create a VPN gateway.
Period Integer No 1

Specifies the subscription duration. Valid values: 1 to 9, 12, 24, and 36. Unit: months.

Note If the InstanceChargeType parameter is set to PREPAY, this parameter is required.
AutoPay Boolean No false

Specifies whether to enable automatic payment for the VPN gateway. Valid values:

  • true: enables automatic payment for the VPN gateway.
  • false (default): disables automatic payment for the VPN gateway.
EnableIpsec Boolean No true

Specifies whether to enable the IPsec-VPN feature. Valid values:

  • true (default): enables the IPsec-VPN feature.
  • false: disables the IPsec-VPN feature.
EnableSsl Boolean No true

Specifies whether to enable the SSL-VPN feature. Valid values:

  • true: enables the SSL-VPN feature.
  • false (default): disables the SSL-VPN feature.
SslConnections Integer No 5

The maximum number of concurrent connections. Valid values: 5, 10, and 20.

VSwitchId String No vsw-bp1j5miw2bae9s2vt****

The ID of the vSwitch where the VPN gateway is deployed.

VpnType String No Normal

The type of the VPN gateway. Valid values:

  • Normal (default): a standard VPN gateway.
  • NationalStandard: a China Certification VPN gateway.
ClientToken String No 02fb3da4****

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

Response parameters

Parameter Type Example Description
Name String vpn-uf68lxhgr7ftbqr3p****

The name of the VPN gateway.

OrderId Long 208240895400460

The ID of the order.

If automatic payment is disabled, you must manually complete the payment for the VPN gateway in the Alibaba Cloud Management console.

RequestId String EB2C156A-41F8-49CC-A756-D55AFC8BFD69

The ID of the request.

VpnGatewayId String vpn-uf68lxhgr7ftbqr3p****

The ID of the VPN gateway.

Examples

Sample requests

http(s)://[Endpoint]/? Action=CreateVpnGateway
&Bandwidth=5
&RegionId=cn-hangzhou
&VpcId=vpc-bp1ub1yt9cvakoelj****
&<Common request parameters>

Sample success responses

XML format

<CreateVpnGatewayResponse>
  <RequestId>EB2C156A-41F8-49CC-A756-D55AFC8BFD69</RequestId>
  <VpnGatewayId>vpn-uf68lxhgr7ftbqr3p****</VpnGatewayId>
  <OrderId>208240895400460</OrderId>
  <Name>vpn-uf68lxhgr7ftbqr3p****</Name>
</CreateVpnGatewayResponse>

JSON format

{
  "RequestId": "EB2C156A-41F8-49CC-A756-D55AFC8BFD69",
  "VpnGatewayId": "vpn-uf68lxhgr7ftbqr3p****",
  "OrderId": 208240895400460,
  "Name": "vpn-uf68lxhgr7ftbqr3p****"
}

Error codes

HttpCode Error code Error message Description
400 Resource.QuotaFull The quota of resource is full The error message returned because the resource quota is reached.

For a list of error codes, visit the API Error Center.