Skip to main content

vpn_connections

Creates, updates, deletes or gets a vpn_connection resource or lists vpn_connections in a region

Overview

Namevpn_connections
TypeResource
DescriptionSpecifies a VPN connection between a virtual private gateway and a VPN customer gateway or a transit gateway and a VPN customer gateway.
To specify a VPN connection between a transit gateway and customer gateway, use the TransitGatewayId and CustomerGatewayId properties.
To specify a VPN connection between a virtual private gateway and customer gateway, use the VpnGatewayId and CustomerGatewayId properties.
For more information, see [](https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) in the *User Guide*.
Idaws.ec2.vpn_connections

Fields

NameDatatypeDescription
remote_ipv6_network_cidrstringThe IPv6 CIDR on the AWS side of the VPN connection.
Default: ::/0
remote_ipv4_network_cidrstringThe IPv4 CIDR on the AWS side of the VPN connection.
Default: 0.0.0.0/0
vpn_tunnel_options_specificationsarrayThe tunnel options for the VPN connection.
customer_gateway_idstringThe ID of the customer gateway at your end of the VPN connection.
outside_ip_address_typestringThe type of IPv4 address assigned to the outside interface of the customer gateway device.
Valid values: PrivateIpv4 | PublicIpv4
Default: PublicIpv4
static_routes_onlybooleanIndicates whether the VPN connection uses static routes only. Static routes must be used for devices that don't support BGP.
If you are creating a VPN connection for a device that does not support Border Gateway Protocol (BGP), you must specify true.
enable_accelerationbooleanIndicate whether to enable acceleration for the VPN connection.
Default: false
transit_gateway_idstringThe ID of the transit gateway associated with the VPN connection.
You must specify either TransitGatewayId or VpnGatewayId, but not both.
typestringThe type of VPN connection.
local_ipv4_network_cidrstringThe IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection.
Default: 0.0.0.0/0
vpn_gateway_idstringThe ID of the virtual private gateway at the AWS side of the VPN connection.
You must specify either TransitGatewayId or VpnGatewayId, but not both.
transport_transit_gateway_attachment_idstringThe transit gateway attachment ID to use for the VPN tunnel.
Required if OutsideIpAddressType is set to PrivateIpv4.
local_ipv6_network_cidrstringThe IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection.
Default: ::/0
vpn_connection_idstring
tunnel_inside_ip_versionstringIndicate whether the VPN tunnels process IPv4 or IPv6 traffic.
Default: ipv4
tagsarrayAny tags assigned to the VPN connection.
regionstringAWS region.

For more information, see AWS::EC2::VPNConnection.

Methods

NameAccessible byRequired Params
create_resourceINSERTType, CustomerGatewayId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all vpn_connections in a region.

SELECT
region,
remote_ipv6_network_cidr,
remote_ipv4_network_cidr,
vpn_tunnel_options_specifications,
customer_gateway_id,
outside_ip_address_type,
static_routes_only,
enable_acceleration,
transit_gateway_id,
type,
local_ipv4_network_cidr,
vpn_gateway_id,
transport_transit_gateway_attachment_id,
local_ipv6_network_cidr,
vpn_connection_id,
tunnel_inside_ip_version,
tags
FROM aws.ec2.vpn_connections
WHERE region = 'us-east-1';

Gets all properties from an individual vpn_connection.

SELECT
region,
remote_ipv6_network_cidr,
remote_ipv4_network_cidr,
vpn_tunnel_options_specifications,
customer_gateway_id,
outside_ip_address_type,
static_routes_only,
enable_acceleration,
transit_gateway_id,
type,
local_ipv4_network_cidr,
vpn_gateway_id,
transport_transit_gateway_attachment_id,
local_ipv6_network_cidr,
vpn_connection_id,
tunnel_inside_ip_version,
tags
FROM aws.ec2.vpn_connections
WHERE region = 'us-east-1' AND data__Identifier = '<VpnConnectionId>';

INSERT example

Use the following StackQL query and manifest file to create a new vpn_connection resource, using stack-deploy.

/*+ create */
INSERT INTO aws.ec2.vpn_connections (
CustomerGatewayId,
Type,
region
)
SELECT
'{{ CustomerGatewayId }}',
'{{ Type }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ec2.vpn_connections
WHERE data__Identifier = '<VpnConnectionId>'
AND region = 'us-east-1';

Permissions

To operate on the vpn_connections resource, the following permissions are required:

Read

ec2:DescribeVpnConnections

Create

ec2:DescribeVpnConnections,
ec2:CreateVpnConnection,
ec2:CreateTags

Update

ec2:DescribeVpnConnections,
ec2:CreateTags,
ec2:DeleteTags

List

ec2:DescribeVpnConnections

Delete

ec2:DescribeVpnConnections,
ec2:DeleteVpnConnection