# CfnVPNConnectionProps

Properties for defining a `CfnVPNConnection`.

Used as props by: [CfnVPNConnection](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnVPNConnection.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const cfnVPNConnectionProps: ec2.CfnVPNConnectionProps = {
  customerGatewayId: 'customerGatewayId',
  type: 'type',

  // the properties below are optional
  enableAcceleration: false,
  localIpv4NetworkCidr: 'localIpv4NetworkCidr',
  localIpv6NetworkCidr: 'localIpv6NetworkCidr',
  outsideIpAddressType: 'outsideIpAddressType',
  preSharedKeyStorage: 'preSharedKeyStorage',
  remoteIpv4NetworkCidr: 'remoteIpv4NetworkCidr',
  remoteIpv6NetworkCidr: 'remoteIpv6NetworkCidr',
  staticRoutesOnly: false,
  tags: [{
    key: 'key',
    value: 'value',
  }],
  transitGatewayId: 'transitGatewayId',
  transportTransitGatewayAttachmentId: 'transportTransitGatewayAttachmentId',
  tunnelBandwidth: 'tunnelBandwidth',
  tunnelInsideIpVersion: 'tunnelInsideIpVersion',
  vpnConcentratorId: 'vpnConcentratorId',
  vpnGatewayId: 'vpnGatewayId',
  vpnTunnelOptionsSpecifications: [{
    dpdTimeoutAction: 'dpdTimeoutAction',
    dpdTimeoutSeconds: 123,
    enableTunnelLifecycleControl: false,
    ikeVersions: [{
      value: 'value',
    }],
    logOptions: {
      cloudwatchLogOptions: {
        bgpLogEnabled: false,
        bgpLogGroupArn: 'bgpLogGroupArn',
        bgpLogOutputFormat: 'bgpLogOutputFormat',
        logEnabled: false,
        logGroupArn: 'logGroupArn',
        logOutputFormat: 'logOutputFormat',
      },
    },
    phase1DhGroupNumbers: [{
      value: 123,
    }],
    phase1EncryptionAlgorithms: [{
      value: 'value',
    }],
    phase1IntegrityAlgorithms: [{
      value: 'value',
    }],
    phase1LifetimeSeconds: 123,
    phase2DhGroupNumbers: [{
      value: 123,
    }],
    phase2EncryptionAlgorithms: [{
      value: 'value',
    }],
    phase2IntegrityAlgorithms: [{
      value: 'value',
    }],
    phase2LifetimeSeconds: 123,
    preSharedKey: 'preSharedKey',
    rekeyFuzzPercentage: 123,
    rekeyMarginTimeSeconds: 123,
    replayWindowSize: 123,
    startupAction: 'startupAction',
    tunnelInsideCidr: 'tunnelInsideCidr',
    tunnelInsideIpv6Cidr: 'tunnelInsideIpv6Cidr',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

cfn_vpn_connection_props = ec2.CfnVPNConnectionProps(
    customer_gateway_id="customerGatewayId",
    type="type",

    # the properties below are optional
    enable_acceleration=False,
    local_ipv4_network_cidr="localIpv4NetworkCidr",
    local_ipv6_network_cidr="localIpv6NetworkCidr",
    outside_ip_address_type="outsideIpAddressType",
    pre_shared_key_storage="preSharedKeyStorage",
    remote_ipv4_network_cidr="remoteIpv4NetworkCidr",
    remote_ipv6_network_cidr="remoteIpv6NetworkCidr",
    static_routes_only=False,
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    transit_gateway_id="transitGatewayId",
    transport_transit_gateway_attachment_id="transportTransitGatewayAttachmentId",
    tunnel_bandwidth="tunnelBandwidth",
    tunnel_inside_ip_version="tunnelInsideIpVersion",
    vpn_concentrator_id="vpnConcentratorId",
    vpn_gateway_id="vpnGatewayId",
    vpn_tunnel_options_specifications=[ec2.CfnVPNConnection.VpnTunnelOptionsSpecificationProperty(
        dpd_timeout_action="dpdTimeoutAction",
        dpd_timeout_seconds=123,
        enable_tunnel_lifecycle_control=False,
        ike_versions=[{
            "value": "value"
        }],
        log_options=ec2.CfnVPNConnection.VpnTunnelLogOptionsSpecificationProperty(
            cloudwatch_log_options=ec2.CfnVPNConnection.CloudwatchLogOptionsSpecificationProperty(
                bgp_log_enabled=False,
                bgp_log_group_arn="bgpLogGroupArn",
                bgp_log_output_format="bgpLogOutputFormat",
                log_enabled=False,
                log_group_arn="logGroupArn",
                log_output_format="logOutputFormat"
            )
        ),
        phase1_dh_group_numbers=[ec2.CfnVPNConnection.Phase1DHGroupNumbersRequestListValueProperty(
            value=123
        )],
        phase1_encryption_algorithms=[ec2.CfnVPNConnection.Phase1EncryptionAlgorithmsRequestListValueProperty(
            value="value"
        )],
        phase1_integrity_algorithms=[ec2.CfnVPNConnection.Phase1IntegrityAlgorithmsRequestListValueProperty(
            value="value"
        )],
        phase1_lifetime_seconds=123,
        phase2_dh_group_numbers=[ec2.CfnVPNConnection.Phase2DHGroupNumbersRequestListValueProperty(
            value=123
        )],
        phase2_encryption_algorithms=[ec2.CfnVPNConnection.Phase2EncryptionAlgorithmsRequestListValueProperty(
            value="value"
        )],
        phase2_integrity_algorithms=[ec2.CfnVPNConnection.Phase2IntegrityAlgorithmsRequestListValueProperty(
            value="value"
        )],
        phase2_lifetime_seconds=123,
        pre_shared_key="preSharedKey",
        rekey_fuzz_percentage=123,
        rekey_margin_time_seconds=123,
        replay_window_size=123,
        startup_action="startupAction",
        tunnel_inside_cidr="tunnelInsideCidr",
        tunnel_inside_ipv6_cidr="tunnelInsideIpv6Cidr"
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

CfnVPNConnectionProps cfnVPNConnectionProps = CfnVPNConnectionProps.builder()
        .customerGatewayId("customerGatewayId")
        .type("type")

        // the properties below are optional
        .enableAcceleration(false)
        .localIpv4NetworkCidr("localIpv4NetworkCidr")
        .localIpv6NetworkCidr("localIpv6NetworkCidr")
        .outsideIpAddressType("outsideIpAddressType")
        .preSharedKeyStorage("preSharedKeyStorage")
        .remoteIpv4NetworkCidr("remoteIpv4NetworkCidr")
        .remoteIpv6NetworkCidr("remoteIpv6NetworkCidr")
        .staticRoutesOnly(false)
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .transitGatewayId("transitGatewayId")
        .transportTransitGatewayAttachmentId("transportTransitGatewayAttachmentId")
        .tunnelBandwidth("tunnelBandwidth")
        .tunnelInsideIpVersion("tunnelInsideIpVersion")
        .vpnConcentratorId("vpnConcentratorId")
        .vpnGatewayId("vpnGatewayId")
        .vpnTunnelOptionsSpecifications(List.of(VpnTunnelOptionsSpecificationProperty.builder()
                .dpdTimeoutAction("dpdTimeoutAction")
                .dpdTimeoutSeconds(123)
                .enableTunnelLifecycleControl(false)
                .ikeVersions(List.of(Map.of(
                        "value", "value")))
                .logOptions(VpnTunnelLogOptionsSpecificationProperty.builder()
                        .cloudwatchLogOptions(CloudwatchLogOptionsSpecificationProperty.builder()
                                .bgpLogEnabled(false)
                                .bgpLogGroupArn("bgpLogGroupArn")
                                .bgpLogOutputFormat("bgpLogOutputFormat")
                                .logEnabled(false)
                                .logGroupArn("logGroupArn")
                                .logOutputFormat("logOutputFormat")
                                .build())
                        .build())
                .phase1DhGroupNumbers(List.of(Phase1DHGroupNumbersRequestListValueProperty.builder()
                        .value(123)
                        .build()))
                .phase1EncryptionAlgorithms(List.of(Phase1EncryptionAlgorithmsRequestListValueProperty.builder()
                        .value("value")
                        .build()))
                .phase1IntegrityAlgorithms(List.of(Phase1IntegrityAlgorithmsRequestListValueProperty.builder()
                        .value("value")
                        .build()))
                .phase1LifetimeSeconds(123)
                .phase2DhGroupNumbers(List.of(Phase2DHGroupNumbersRequestListValueProperty.builder()
                        .value(123)
                        .build()))
                .phase2EncryptionAlgorithms(List.of(Phase2EncryptionAlgorithmsRequestListValueProperty.builder()
                        .value("value")
                        .build()))
                .phase2IntegrityAlgorithms(List.of(Phase2IntegrityAlgorithmsRequestListValueProperty.builder()
                        .value("value")
                        .build()))
                .phase2LifetimeSeconds(123)
                .preSharedKey("preSharedKey")
                .rekeyFuzzPercentage(123)
                .rekeyMarginTimeSeconds(123)
                .replayWindowSize(123)
                .startupAction("startupAction")
                .tunnelInsideCidr("tunnelInsideCidr")
                .tunnelInsideIpv6Cidr("tunnelInsideIpv6Cidr")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

var cfnVPNConnectionProps = new CfnVPNConnectionProps {
    CustomerGatewayId = "customerGatewayId",
    Type = "type",

    // the properties below are optional
    EnableAcceleration = false,
    LocalIpv4NetworkCidr = "localIpv4NetworkCidr",
    LocalIpv6NetworkCidr = "localIpv6NetworkCidr",
    OutsideIpAddressType = "outsideIpAddressType",
    PreSharedKeyStorage = "preSharedKeyStorage",
    RemoteIpv4NetworkCidr = "remoteIpv4NetworkCidr",
    RemoteIpv6NetworkCidr = "remoteIpv6NetworkCidr",
    StaticRoutesOnly = false,
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    TransitGatewayId = "transitGatewayId",
    TransportTransitGatewayAttachmentId = "transportTransitGatewayAttachmentId",
    TunnelBandwidth = "tunnelBandwidth",
    TunnelInsideIpVersion = "tunnelInsideIpVersion",
    VpnConcentratorId = "vpnConcentratorId",
    VpnGatewayId = "vpnGatewayId",
    VpnTunnelOptionsSpecifications = new [] { new VpnTunnelOptionsSpecificationProperty {
        DpdTimeoutAction = "dpdTimeoutAction",
        DpdTimeoutSeconds = 123,
        EnableTunnelLifecycleControl = false,
        IkeVersions = new [] { new Dictionary<string, string?> {
            { "value", "value" }
        } },
        LogOptions = new VpnTunnelLogOptionsSpecificationProperty {
            CloudwatchLogOptions = new CloudwatchLogOptionsSpecificationProperty {
                BgpLogEnabled = false,
                BgpLogGroupArn = "bgpLogGroupArn",
                BgpLogOutputFormat = "bgpLogOutputFormat",
                LogEnabled = false,
                LogGroupArn = "logGroupArn",
                LogOutputFormat = "logOutputFormat"
            }
        },
        Phase1DhGroupNumbers = new [] { new Phase1DHGroupNumbersRequestListValueProperty {
            Value = 123
        } },
        Phase1EncryptionAlgorithms = new [] { new Phase1EncryptionAlgorithmsRequestListValueProperty {
            Value = "value"
        } },
        Phase1IntegrityAlgorithms = new [] { new Phase1IntegrityAlgorithmsRequestListValueProperty {
            Value = "value"
        } },
        Phase1LifetimeSeconds = 123,
        Phase2DhGroupNumbers = new [] { new Phase2DHGroupNumbersRequestListValueProperty {
            Value = 123
        } },
        Phase2EncryptionAlgorithms = new [] { new Phase2EncryptionAlgorithmsRequestListValueProperty {
            Value = "value"
        } },
        Phase2IntegrityAlgorithms = new [] { new Phase2IntegrityAlgorithmsRequestListValueProperty {
            Value = "value"
        } },
        Phase2LifetimeSeconds = 123,
        PreSharedKey = "preSharedKey",
        RekeyFuzzPercentage = 123,
        RekeyMarginTimeSeconds = 123,
        ReplayWindowSize = 123,
        StartupAction = "startupAction",
        TunnelInsideCidr = "tunnelInsideCidr",
        TunnelInsideIpv6Cidr = "tunnelInsideIpv6Cidr"
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnVPNConnectionProps := &CfnVPNConnectionProps{
	CustomerGatewayId: jsii.String("customerGatewayId"),
	Type: jsii.String("type"),

	// the properties below are optional
	EnableAcceleration: jsii.Boolean(false),
	LocalIpv4NetworkCidr: jsii.String("localIpv4NetworkCidr"),
	LocalIpv6NetworkCidr: jsii.String("localIpv6NetworkCidr"),
	OutsideIpAddressType: jsii.String("outsideIpAddressType"),
	PreSharedKeyStorage: jsii.String("preSharedKeyStorage"),
	RemoteIpv4NetworkCidr: jsii.String("remoteIpv4NetworkCidr"),
	RemoteIpv6NetworkCidr: jsii.String("remoteIpv6NetworkCidr"),
	StaticRoutesOnly: jsii.Boolean(false),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	TransitGatewayId: jsii.String("transitGatewayId"),
	TransportTransitGatewayAttachmentId: jsii.String("transportTransitGatewayAttachmentId"),
	TunnelBandwidth: jsii.String("tunnelBandwidth"),
	TunnelInsideIpVersion: jsii.String("tunnelInsideIpVersion"),
	VpnConcentratorId: jsii.String("vpnConcentratorId"),
	VpnGatewayId: jsii.String("vpnGatewayId"),
	VpnTunnelOptionsSpecifications: []interface{}{
		&VpnTunnelOptionsSpecificationProperty{
			DpdTimeoutAction: jsii.String("dpdTimeoutAction"),
			DpdTimeoutSeconds: jsii.Number(123),
			EnableTunnelLifecycleControl: jsii.Boolean(false),
			IkeVersions: []interface{}{
				map[string]*string{
					"value": jsii.String("value"),
				},
			},
			LogOptions: &VpnTunnelLogOptionsSpecificationProperty{
				CloudwatchLogOptions: &CloudwatchLogOptionsSpecificationProperty{
					BgpLogEnabled: jsii.Boolean(false),
					BgpLogGroupArn: jsii.String("bgpLogGroupArn"),
					BgpLogOutputFormat: jsii.String("bgpLogOutputFormat"),
					LogEnabled: jsii.Boolean(false),
					LogGroupArn: jsii.String("logGroupArn"),
					LogOutputFormat: jsii.String("logOutputFormat"),
				},
			},
			Phase1DhGroupNumbers: []interface{}{
				&Phase1DHGroupNumbersRequestListValueProperty{
					Value: jsii.Number(123),
				},
			},
			Phase1EncryptionAlgorithms: []interface{}{
				&Phase1EncryptionAlgorithmsRequestListValueProperty{
					Value: jsii.String("value"),
				},
			},
			Phase1IntegrityAlgorithms: []interface{}{
				&Phase1IntegrityAlgorithmsRequestListValueProperty{
					Value: jsii.String("value"),
				},
			},
			Phase1LifetimeSeconds: jsii.Number(123),
			Phase2DhGroupNumbers: []interface{}{
				&Phase2DHGroupNumbersRequestListValueProperty{
					Value: jsii.Number(123),
				},
			},
			Phase2EncryptionAlgorithms: []interface{}{
				&Phase2EncryptionAlgorithmsRequestListValueProperty{
					Value: jsii.String("value"),
				},
			},
			Phase2IntegrityAlgorithms: []interface{}{
				&Phase2IntegrityAlgorithmsRequestListValueProperty{
					Value: jsii.String("value"),
				},
			},
			Phase2LifetimeSeconds: jsii.Number(123),
			PreSharedKey: jsii.String("preSharedKey"),
			RekeyFuzzPercentage: jsii.Number(123),
			RekeyMarginTimeSeconds: jsii.Number(123),
			ReplayWindowSize: jsii.Number(123),
			StartupAction: jsii.String("startupAction"),
			TunnelInsideCidr: jsii.String("tunnelInsideCidr"),
			TunnelInsideIpv6Cidr: jsii.String("tunnelInsideIpv6Cidr"),
		},
	},
}
```

## Properties

- `customerGatewayId`: string | [ICustomerGatewayRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.ICustomerGatewayRef.html) (required) — The ID of the customer gateway at your end of the VPN connection.

- `enableAcceleration`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicate whether to enable acceleration for the VPN connection.

  Default: `false`

- `localIpv4NetworkCidr`: string — The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection.

  Default: `0.0.0.0/0`

- `localIpv6NetworkCidr`: string — The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection.

  Default: `::/0`

- `outsideIpAddressType`: string — The type of IP address assigned to the outside interface of the customer gateway device.

  Valid values: `PrivateIpv4` | `PublicIpv4` | `Ipv6`

  Default: `PublicIpv4`

- `preSharedKeyStorage`: string — Describes the storage location for an instance store-backed AMI.

- `remoteIpv4NetworkCidr`: string — The IPv4 CIDR on the AWS side of the VPN connection.

  Default: `0.0.0.0/0`

- `remoteIpv6NetworkCidr`: string — The IPv6 CIDR on the AWS side of the VPN connection.

  Default: `::/0`

- `staticRoutesOnly`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates 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` .

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — Any tags assigned to the VPN connection.

- `transitGatewayId`: string | [ITransitGatewayRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.ITransitGatewayRef.html) — The ID of the transit gateway associated with the VPN connection.

  You must specify either `TransitGatewayId` or `VpnGatewayId` , but not both.

- `transportTransitGatewayAttachmentId`: string — The transit gateway attachment ID to use for the VPN tunnel.

  Required if `OutsideIpAddressType` is set to `PrivateIpv4` .

- `tunnelBandwidth`: string = "standard" — The desired bandwidth specification for the VPN tunnel, used when creating or modifying VPN connection options to set the tunnel's throughput capacity.

  `standard` supports up to 1.25 Gbps per tunnel, while `large` supports up to 5 Gbps per tunnel. The default value is `standard` . Existing VPN connections without a bandwidth setting will automatically default to `standard` .

- `tunnelInsideIpVersion`: string — Indicate whether the VPN tunnels process IPv4 or IPv6 traffic.

  Default: `ipv4`

- `type`: string (required) — The type of VPN connection.

- `vpnConcentratorId`: string — The ID of the VPN concentrator to associate with the VPN connection.

- `vpnGatewayId`: string | [IVPNGatewayRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.IVPNGatewayRef.html) — The ID of the virtual private gateway at the AWS side of the VPN connection.

  You must specify either `TransitGatewayId` or `VpnGatewayId` , but not both.

- `vpnTunnelOptionsSpecifications`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnVPNConnection.VpnTunnelOptionsSpecificationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnVPNConnection.VpnTunnelOptionsSpecificationProperty.html)[] — The tunnel options for the VPN connection.
