create_vpn_connection ( $type, $customer_gateway_id, $vpn_gateway_id, $opt )

Creates a new VPN connection between an existing VPN gateway and customer gateway. The only supported connection type is ipsec.1.

The response includes information that you need to configure your customer gateway, in XML format. We recommend you use the command line version of this operation (ec2-create-vpn-connection), which takes an -f option (for format) and returns configuration information formatted as expected by the vendor you specified, or in a generic, human readable format. For information about the command, go to ec2-create-vpn-connection in the Amazon Virtual Private Cloud Command Line Reference.

We strongly recommend you use HTTPS when calling this operation because the response contains sensitive cryptographic information for configuring your customer gateway.

If you decide to shut down your VPN connection for any reason and then create a new one, you must re-configure your customer gateway with the new information returned from this call.

Access

public

Parameters

Parameter

Type

Required

Description

$type

string

Required

The type of VPN connection.

$customer_gateway_id

string

Required

The ID of the customer gateway.

$vpn_gateway_id

string

Required

The ID of the VPN gateway.

$opt

array

Optional

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

  • Options - array - Optional -
    • x - array - Optional - This represents a simple array index.
      • StaticRoutesOnly - boolean - Optional -
  • 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

Create a new VPN connection.

$ec2 = new AmazonEC2();

$response = $ec2->create_vpn_connection('ipsec.1', 'cgw-10a84c79', 'vgw-9aa347f3');

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

Related Methods

Source

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

public function create_vpn_connection($type, $customer_gateway_id, $vpn_gateway_id, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['Type'] = $type;
    $opt['CustomerGatewayId'] = $customer_gateway_id;
    $opt['VpnGatewayId'] = $vpn_gateway_id;
    
    // Optional map (non-list)
    if (isset($opt['Options']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'Options' => $opt['Options']
        )));
        unset($opt['Options']);
    }

    return $this->authenticate('CreateVpnConnection', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback