Skip to content
v2.277.0

EnableVpnGatewayOptions Struct ​

Options for the Vpc.enableVpnGateway() method.

Example ​

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';

declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
const enableVpnGatewayOptions: ec2.EnableVpnGatewayOptions = {
  type: 'type',

  // the properties below are optional
  amazonSideAsn: 123,
  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.
from aws_cdk import aws_ec2 as ec2

# subnet: ec2.Subnet
# subnet_filter: ec2.SubnetFilter

enable_vpn_gateway_options = ec2.EnableVpnGatewayOptions(
    type="type",

    # the properties below are optional
    amazon_side_asn=123,
    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.*;

Subnet subnet;
SubnetFilter subnetFilter;

EnableVpnGatewayOptions enableVpnGatewayOptions = EnableVpnGatewayOptions.builder()
        .type("type")

        // the properties below are optional
        .amazonSideAsn(123)
        .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.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;

Subnet subnet;
SubnetFilter subnetFilter;

var enableVpnGatewayOptions = new EnableVpnGatewayOptions {
    Type = "type",

    // the properties below are optional
    AmazonSideAsn = 123,
    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/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"

var subnet Subnet
var subnetFilter SubnetFilter

enableVpnGatewayOptions := &EnableVpnGatewayOptions{
	Type: jsii.String("type"),

	// the properties below are optional
	AmazonSideAsn: jsii.Number(123),
	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= 65000#
Explicitly specify an Asn or let aws pick an Asn for you.
typestringtypestrtypeStringTypestringType*stringrequired#
Default type ipsec.1.
vpnRoutePropagationoptionalSubnetSelection[]vpn_route_propagationoptionaltyping.List[SubnetSelection]vpnRoutePropagationoptionalList<SubnetSelection>VpnRoutePropagationoptionalSubnetSelection[]VpnRoutePropagationoptional*[]SubnetSelection= noPropagation#
Provide an array of subnets where the route propagation should be added.