CreateVpnConnection

Description

Creates a VPN connection between a VPN gateway and a customer VPN gateway.

VPN gateway is created automatically for each virtual private cloud, and its ID can be checked using DescribeVpnGateways. For convenience, VPN gateway’s ID is the same as ID of VPC, to which it belongs (vpc-ABCD1234/vgw-ABCD1234).

There can be only one VPN connection between customer gateway and VPC (VPN gateway). If you try to create a VPN connection again, the operation will success, but the existing VPN connection object will be responded.

For more information see VPN connections section.

Request Parameters

  • Type - The type of VPN connection

    • Required: Yes

    • Type: String

    • Valid values: ipsec.1 | ipsec.legacy

  • CustomerGatewayId - The ID of the customer gateway

    • Required: Yes

    • Type: String

  • VpnGatewayId - The ID of the virtual private gateway

    • Required: Yes

    • Type: String

  • TagSpecification.N – Tags assigned to the being created resource.

  • Options - additional options for VPN connection.

Response Elements

  • requestId - The ID of the request

  • vpnConnection - Information about VPN connection

Examples

c2-ec2 CreateVpnConnection CustomerGatewayId <customer_gateway_id> Type <type> VpnGatewayId <vpn_gateway_id>
c2-ec2 CreateVpnConnection CustomerGatewayId <customer_gateway_id> Type <type> VpnGatewayId <vpn_gateway_id> Options.TunnelOptions.0.PreSharedKey <pre_shared_key> Options.TunnelOptions.0.TunnelInsideCidr <tunnel_inside_cidr>
c2-ec2 CreateVpnConnection CustomerGatewayId <customer_gateway_id> Type <type> VpnGatewayId <vpn_gateway_id> \
Options.TunnelOptions.0.PreSharedKey <pre_shared_key> Options.TunnelOptions.0.TunnelInsideCidr <tunnel_inside_cidr> \
TagSpecification.0.ResourceType vpn-connection TagSpecification.0.Tag.0.Key "tag_key" TagSpecification.0.Tag.0.Value "tag_value"