Creates a VPN Gateway.

Debug

By using API Explorer, you can easily debug APIs, automatically generate SDK code examples, and quickly search for APIs.

Request parameters

Parameter Type Required? Example value Description
Action  String  Yes CreateVpnGateway

The action to perform.  Valid value: 

CreateVpnGateway

Bandwidth Integer Yes 5

The bandwidth in Mbps of the VPN Gateway. Valid values:

5 |10 | 20 | 50 | 100

RegionId String   Yes cn-hangzhou

The ID of the region to which the VPN Gateway belongs.

To query the region ID, call DescribeRegions.

VpcId String   Yes vpc-bp1ub1yt9cvakoelj1y9c

The ID of the VPC to which the VPN Gateway belongs.

Autopay Boolean  No false

Indicates whether the bill is paid automatically. Valid values:

true | false (default)

EnableIpsec Boolean  No true

Indicates whether to enable the IPsec-VPN function. The IPsec-VPN function provides a site-to-site connection. You can create an IPsec tunnel to connect an on-premises data center to a VPC, or to connect two VPCs. Valid values:

true (default) | false

EnableSsl Boolean  No true

Indicates whether to enable the SSL-VPN function. If this function is enabled, point-to-site VPN connection is provided and customer gateway configuration is not needed. Valid values:

true | false (default)

InstanceChargeType String No PREPAY
The billing method of the VPN Gateway. Valid values:
  • Postpay: Pay-As-You-Go billing based on the traffic.

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 100 characters in length and contain letters, numbers, periods (.), underscores (_), and hyphens (-). The name must start with a letter. It cannot start with http:// or https://.

Period Integer No 1

The validity period of a subscription. Valid values: 1-9 | 12 | 24 | 36

SslConnections Integer No 2 The maximum number of clients allowed to connect simultaneously.

Response parameters

Parameter Type Example value Description
Name String myVpn The name of the VPN Gateway.
OrderId String 202249400220415 The ID of the order. Go to the console to complete the payment.
RequestId String 54B48E3D-DF70-471B-AA93-08E683A1B457 The ID of the request.
VpnGatewayId String vpn-bp1q8bgx4xnkm2ogj0fiu The ID of the VPN Gateway.

Examples

Request example


https://vpc.aliyuncs.com/?Action=CreateVpnGateway
&Bandwidth=5
&RegionId=cn-hangzhou
&VpcId=vpc-bp1ub1yt9cvakoelj1y9c
&Name=MYVPN
&InstanceChargeType=PREPAY
&Period=1
&AutoPay=false
&EnableIpsec=true
&EnableSsl=true
&SslConnections=2
&<CommonParameters>
Response example
  • XML format

    <CreateVpnGatewayResponse>
      <Name>myVpn</Name>
      <VpnGatewayId>vpn-bp1q8bgx4xnkm2ogj0fiu</VpnGatewayId>
      <RequestId>54B48E3D-DF70-471B-AA93-08E683A1B457</RequestId>
    </CreateVpnGatewayResponse>
    
  • JSON format

    {
    	"CreateVpnGatewayResponse":{
    		"Name":"myVpn",
    		"VpnGatewayId":"vpn-bp1q8bgx4xnkm2ogj0fiu",
    		"RequestId":"54B48E3D-DF70-471B-AA93-08E683A1B457"
    	}
    }

Error codes

HTTP status code Error code Error message Description
400 Resource.QuotaFull The quota of resource is full The resource quota has been reached.

See common error codes