Skip to content

EC2  >  Operations  >  create_vpn_connection

create_vpn_connection

Operation

create_vpn_connection async

create_vpn_connection(input: CreateVpnConnectionInput, plugins: list[Plugin] | None = None) -> CreateVpnConnectionOutput

Creates a VPN connection between an existing virtual private gateway or transit gateway and a customer gateway. The supported connection type is ipsec.1.

The response includes information that you need to give to your network administrator to configure your customer gateway.

Warning

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

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

This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.

For more information, see Amazon Web Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN User Guide.

Parameters:

Name Type Description Default
input CreateVpnConnectionInput

An instance of CreateVpnConnectionInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateVpnConnectionOutput

An instance of CreateVpnConnectionOutput.

Input

CreateVpnConnectionInput dataclass

Bases: _SerdeShape

Contains the parameters for CreateVpnConnection.

Attributes

customer_gateway_id class-attribute instance-attribute
customer_gateway_id: str | None = ...

The ID of the customer gateway.

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

options class-attribute instance-attribute
options: VpnConnectionOptionsSpecification | None = ...

The options for the VPN connection.

pre_shared_key_storage class-attribute instance-attribute
pre_shared_key_storage: str | None = ...

Specifies the storage mode for the pre-shared key (PSK). Valid values are Standard" (stored in the Site-to-Site VPN service) or SecretsManager (stored in Amazon Web Services Secrets Manager).

tag_specifications class-attribute instance-attribute
tag_specifications: list[TagSpecification] | None = ...

The tags to apply to the VPN connection.

transit_gateway_id class-attribute instance-attribute
transit_gateway_id: str | None = ...

The ID of the transit gateway. If you specify a transit gateway, you cannot specify a virtual private gateway.

type class-attribute instance-attribute
type: str | None = ...

The type of VPN connection (ipsec.1).

vpn_concentrator_id class-attribute instance-attribute
vpn_concentrator_id: str | None = ...

The ID of the VPN concentrator to associate with the VPN connection.

vpn_gateway_id class-attribute instance-attribute
vpn_gateway_id: str | None = ...

The ID of the virtual private gateway. If you specify a virtual private gateway, you cannot specify a transit gateway.

Output

CreateVpnConnectionOutput dataclass

Bases: _SerdeShape

Contains the output of CreateVpnConnection.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

vpn_connection class-attribute instance-attribute
vpn_connection: VpnConnection | None = ...

Information about the VPN connection.