Skip to content
v2.274.0

Experimental

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

InternetGatewayOptions Struct ​

Options to define InternetGateway for VPC.

Example ​

ts
const stack = new Stack();
const myVpc = new VpcV2(this, 'Vpc');

const subnet = new SubnetV2(this, 'Subnet', {
  vpc: myVpc,
  availabilityZone: 'eu-west-2a',
  ipv4CidrBlock: new IpCidr('10.0.0.0/24'),
  subnetType: SubnetType.PUBLIC });

myVpc.addInternetGateway({
  ipv4Destination: '192.168.0.0/16',
});

Properties ​

internetGatewayNamestringinternet_gateway_namestrinternetGatewayNameStringInternetGatewayNamestringInternetGatewayName*string#
The resource name of the internet gateway.

Default: provisioned without a resource name

Provided name will be used for tagging

ipv4Destinationstringipv4_destinationstripv4DestinationStringIpv4DestinationstringIpv4Destination*string#
Destination Ipv6 address for EGW route.

Default: '0.0.0.0' all Ipv4 traffic

ipv6Destinationstringipv6_destinationstripv6DestinationStringIpv6DestinationstringIpv6Destination*string#
Destination Ipv6 address for EGW route.

Default: '::/0' all Ipv6 traffic

subnetsSubnetSelection[]subnetstyping.List[SubnetSelection]subnetsList<SubnetSelection>SubnetsSubnetSelection[]Subnets*[]SubnetSelection#
List of subnets where route to IGW will be added.

Default: route created for all subnets with Type SubnetType.Public