Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to Digg

DetachVpnGateway

Description

Detaches a VPN 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 VPN gateway has been completely detached from a VPC by describing the VPN gateway (any attachments to the VPN 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 VPN gateway.

For more information about Amazon Virtual Private Cloud and VPN gateways, go to Adding an IPsec Hardware VPN Gateway to Your VPC in the Amazon Virtual Private Cloud User Guide.

Request Parameters

NameDescriptionRequired

VpnGatewayId

The ID of the VPN gateway you want to detach from the VPC.

Type: String

Default: None

Yes

VpcId

The ID of the VPC you want to detach the VPN gateway from.

Type: String

Default: None

Yes

Response Elements

The elements in the following table are wrapped in an DetachVpnGatewayResponse structure.

NameDescription

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 VPN 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/2011-01-01/">
   <requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId>
   <return>true</return>
</DetachVpnGatewayResponse>