Deletes a VPN Gateway.

Note You cannot delete a VPN Gateway associated with an IPsec connection.


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 DeleteVpnGateway

The name of this action. Value:


RegionId String Yes cn-hangzhou

The ID of the region to which VPN Gateway belongs.

To query the region ID, call DescribeRegions.

VpnGatewayId String Yes vpn-bp1q8bgx4xnkm2ogj0fiu

The ID of the VPN Gateway.

ClientToken String No 02fb3da4-130e-11e9-8e44-0016e04115b

A client token used to guarantee the idempotence of requests. 

This parameter value is generated by the client and must be unique. It must be 1 to 64 ASCII characters in length.

Response parameters

Parameter Type Example value Description
RequestId String >0ED8D006-F706-4D23-88ED-E11ED28DCAC0 The ID of the request.


Request example
Response example
  • XML format

  • JSON format


Error codes

HTTP status code Error code Error message Description
403 Forbbiden.SubUser User not authorized to operate on the specified resource as your account is created by another user. You are not authorized to operate on this resource.
403 Forbidden User not authorized to operate on the specified resource. You are not authorized to operate on this resource. For more information, open a ticket.
404 InvalidVpnGatewayInstanceId.NotFound The specified vpn gateway instance id does not exist. The specified VPN Gateway does not exist.
403 ForbiddenRelease Forbidden to release a prepaid instance within validity period You cannot release a Subscription instance before the expiration date.
400 VpnGateway.Configuring The specified service is configuring. The specified service is being configured. Please try again later.

See common error codes