Skip to content
v2.278.0

Experimental

@aws-cdk/aws-ec2-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

VPNGatewayV2Props Struct ​

Properties to define a VPN gateway.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as ec2_alpha from '@aws-cdk/aws-ec2-alpha';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';

declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpcV2: ec2_alpha.VpcV2;
const vPNGatewayV2Props: ec2_alpha.VPNGatewayV2Props = {
  type: ec2.VpnConnectionType.IPSEC_1,
  vpc: vpcV2,

  // the properties below are optional
  amazonSideAsn: 123,
  vpnGatewayName: 'vpnGatewayName',
  vpnRoutePropagation: [{
    availabilityZones: ['availabilityZones'],
    onePerAz: false,
    subnetFilters: [subnetFilter],
    subnetGroupName: 'subnetGroupName',
    subnets: [subnet],
    subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
  }],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ec2_alpha as ec2_alpha
from aws_cdk import aws_ec2 as ec2

# subnet: ec2.Subnet
# subnet_filter: ec2.SubnetFilter
# vpc_v2: ec2_alpha.VpcV2

v_pn_gateway_v2_props = ec2_alpha.VPNGatewayV2Props(
    type=ec2.VpnConnectionType.IPSEC_1,
    vpc=vpc_v2,

    # the properties below are optional
    amazon_side_asn=123,
    vpn_gateway_name="vpnGatewayName",
    vpn_route_propagation=[ec2.SubnetSelection(
        availability_zones=["availabilityZones"],
        one_per_az=False,
        subnet_filters=[subnet_filter],
        subnet_group_name="subnetGroupName",
        subnets=[subnet],
        subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
    )]
)
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.alpha.*;
import software.amazon.awscdk.services.ec2.*;

Subnet subnet;
SubnetFilter subnetFilter;
VpcV2 vpcV2;

VPNGatewayV2Props vPNGatewayV2Props = VPNGatewayV2Props.builder()
        .type(VpnConnectionType.IPSEC_1)
        .vpc(vpcV2)

        // the properties below are optional
        .amazonSideAsn(123)
        .vpnGatewayName("vpnGatewayName")
        .vpnRoutePropagation(List.of(SubnetSelection.builder()
                .availabilityZones(List.of("availabilityZones"))
                .onePerAz(false)
                .subnetFilters(List.of(subnetFilter))
                .subnetGroupName("subnetGroupName")
                .subnets(List.of(subnet))
                .subnetType(SubnetType.PRIVATE_ISOLATED)
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.ec2.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ec2.Alpha;
using Amazon.CDK.AWS.EC2;

Subnet subnet;
SubnetFilter subnetFilter;
VpcV2 vpcV2;

var vPNGatewayV2Props = new VPNGatewayV2Props {
    Type = VpnConnectionType.IPSEC_1,
    Vpc = vpcV2,

    // the properties below are optional
    AmazonSideAsn = 123,
    VpnGatewayName = "vpnGatewayName",
    VpnRoutePropagation = new [] { new SubnetSelection {
        AvailabilityZones = new [] { "availabilityZones" },
        OnePerAz = false,
        SubnetFilters = new [] { subnetFilter },
        SubnetGroupName = "subnetGroupName",
        Subnets = new [] { subnet },
        SubnetType = SubnetType.PRIVATE_ISOLATED
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awsec2alpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import ec2_alpha "github.com/aws/aws-cdk-go/awsec2alpha"
import "github.com/aws/aws-cdk-go/awscdk"

var subnet Subnet
var subnetFilter SubnetFilter
var vpcV2 VpcV2

vPNGatewayV2Props := &VPNGatewayV2Props{
	Type: awscdk.Aws_ec2.VpnConnectionType_IPSEC_1,
	Vpc: vpcV2,

	// the properties below are optional
	AmazonSideAsn: jsii.Number(123),
	VpnGatewayName: jsii.String("vpnGatewayName"),
	VpnRoutePropagation: []SubnetSelection{
		&SubnetSelection{
			AvailabilityZones: []*string{
				jsii.String("availabilityZones"),
			},
			OnePerAz: jsii.Boolean(false),
			SubnetFilters: []SubnetFilter{
				subnetFilter,
			},
			SubnetGroupName: jsii.String("subnetGroupName"),
			Subnets: []ISubnet{
				subnet,
			},
			SubnetType: awscdk.*Aws_ec2.SubnetType_PRIVATE_ISOLATED,
		},
	},
}

Properties ​

amazonSideAsnoptionalnumberamazon_side_asnoptionalint | floatamazonSideAsnoptionalNumberAmazonSideAsnoptionaldoubleAmazonSideAsnoptional*float64 #
The private Autonomous System Number (ASN) for the Amazon side of a BGP session.

Default: no ASN set for BGP session

The type of VPN connection the virtual private gateway supports.
vpcIVpcV2vpcIVpcV2vpcIVpcV2VpcIVpcV2VpcIVpcV2 required #
The ID of the VPC for which to create the VPN gateway.
vpnGatewayNameoptionalstringvpn_gateway_nameoptionalstrvpnGatewayNameoptionalStringVpnGatewayNameoptionalstringVpnGatewayNameoptional*string #
The resource name of the VPN gateway.

Default: resource provisioned without any name

vpnRoutePropagationoptionalSubnetSelection[]vpn_route_propagationoptionaltyping.List[SubnetSelection]vpnRoutePropagationoptionalList<SubnetSelection>VpnRoutePropagationoptionalSubnetSelection[]VpnRoutePropagationoptional*[]SubnetSelection #
Subnets where the route propagation should be added.

Default: no propagation for routes