detach_vpn_gateway ( $vpn_gateway_id, $vpc_id, $opt )

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.

Access

public

Parameters

Parameter

Type

Required

Description

$vpn_gateway_id

string

Required

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

$vpc_id

string

Required

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

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Detach a VPN gateway from an existing VPC.

$ec2 = new AmazonEC2();

$response = $ec2->detach_vpn_gateway('vgw-9aa347f3', 'vpc-fd7cd194');

var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/ec2.class.php | Toggle source view (8 lines) | View on GitHub

public function detach_vpn_gateway($vpn_gateway_id, $vpc_id, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['VpnGatewayId'] = $vpn_gateway_id;
    $opt['VpcId'] = $vpc_id;
    
    return $this->authenticate('DetachVpnGateway', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback