Amazon Elastic Compute Cloud
API Reference (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

DetachVpnGateway

Description

Detaches a virtual private gateway from a VPC. You do this if you're planning to turn off the VPC and not use it anymore. You can confirm a virtual private gateway has been completely detached from a VPC by describing the virtual private gateway (any attachments to the virtual private gateway are also described).

You must wait for the attachment's state to switch to detached before you can delete the VPC or attach a different VPC to the virtual private gateway.

For more information about virtual private gateways, see Adding an IPsec Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.

Request Parameters

VpnGatewayId

The ID of the virtual private gateway.

Type: String

Default: None

Required: Yes

VpcId

The ID of the VPC.

Type: String

Default: None

Required: Yes

Response Elements

The following elements are returned in a DetachVpnGatewayResponse element.

requestId

The ID of the request.

Type: xsd:string

return

Returns true if the request succeeds. Otherwise, returns an error.

Type: xsd:boolean

Examples

Example Request

This example detaches the virtual private gateway with ID vgw-8db04f81 from the VPC with VPC ID vpc-1a2b3c4d.

https://ec2.amazonaws.com/?Action=DetachVpnGateway
&VpnGatewayId=vgw-8db04f81
&VpcId=vpc-1a2b3c4d
&AUTHPARAMS

Example Response

<DetachVpnGatewayResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
   <requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId>
   <return>true</return>
</DetachVpnGatewayResponse>