aws-cdk.aws-ec2-alpha 2.157.0a0__py3-none-any.whl → 2.159.0a0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of aws-cdk.aws-ec2-alpha might be problematic. Click here for more details.

@@ -25,10 +25,10 @@ To create a VPC with both IPv4 and IPv6 support:
25
25
 
26
26
  ```python
27
27
  stack = Stack()
28
- vpc_v2.VpcV2(self, "Vpc",
29
- primary_address_block=vpc_v2.IpAddresses.ipv4("10.0.0.0/24"),
28
+ VpcV2(self, "Vpc",
29
+ primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
30
30
  secondary_address_blocks=[
31
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIpv6")
31
+ IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIpv6")
32
32
  ]
33
33
  )
34
34
  ```
@@ -44,18 +44,18 @@ This new construct can be used to add subnets to a `VpcV2` instance:
44
44
 
45
45
  ```python
46
46
  stack = Stack()
47
- my_vpc = vpc_v2.VpcV2(self, "Vpc",
47
+ my_vpc = VpcV2(self, "Vpc",
48
48
  secondary_address_blocks=[
49
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIp")
49
+ IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIp")
50
50
  ]
51
51
  )
52
52
 
53
- vpc_v2.SubnetV2(self, "subnetA",
53
+ SubnetV2(self, "subnetA",
54
54
  vpc=my_vpc,
55
55
  availability_zone="us-east-1a",
56
- ipv4_cidr_block=vpc_v2.IpCidr("10.0.0.0/24"),
57
- ipv6_cidr_block=vpc_v2.IpCidr("2a05:d02c:25:4000::/60"),
58
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
56
+ ipv4_cidr_block=IpCidr("10.0.0.0/24"),
57
+ ipv6_cidr_block=IpCidr("2a05:d02c:25:4000::/60"),
58
+ subnet_type=SubnetType.PRIVATE_ISOLATED
59
59
  )
60
60
  ```
61
61
 
@@ -73,28 +73,28 @@ ipam = Ipam(self, "Ipam",
73
73
  operating_region=["us-west-1"]
74
74
  )
75
75
  ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
76
- address_family=vpc_v2.AddressFamily.IP_V6,
76
+ address_family=AddressFamily.IP_V6,
77
77
  aws_service=AwsServiceName.EC2,
78
78
  locale="us-west-1",
79
- public_ip_source=vpc_v2.IpamPoolPublicIpSource.AMAZON
79
+ public_ip_source=IpamPoolPublicIpSource.AMAZON
80
80
  )
81
81
  ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
82
82
 
83
83
  ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
84
- address_family=vpc_v2.AddressFamily.IP_V4
84
+ address_family=AddressFamily.IP_V4
85
85
  )
86
86
  ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
87
87
 
88
- vpc_v2.VpcV2(self, "Vpc",
89
- primary_address_block=vpc_v2.IpAddresses.ipv4("10.0.0.0/24"),
88
+ VpcV2(self, "Vpc",
89
+ primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
90
90
  secondary_address_blocks=[
91
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
92
- vpc_v2.IpAddresses.ipv6_ipam(
91
+ IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
92
+ IpAddresses.ipv6_ipam(
93
93
  ipam_pool=ipam_public_pool,
94
94
  netmask_length=52,
95
95
  cidr_block_name="ipv6Ipam"
96
96
  ),
97
- vpc_v2.IpAddresses.ipv4_ipam(
97
+ IpAddresses.ipv4_ipam(
98
98
  ipam_pool=ipam_private_pool,
99
99
  netmask_length=8,
100
100
  cidr_block_name="ipv4Ipam"
@@ -110,65 +110,88 @@ Since `VpcV2` does not create subnets automatically, users have full control ove
110
110
  `RouteTable` is a new construct that allows for route tables to be customized in a variety of ways. For instance, the following example shows how a custom route table can be created and appended to a subnet:
111
111
 
112
112
  ```python
113
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
114
- route_table = vpc_v2.RouteTable(self, "RouteTable",
113
+ my_vpc = VpcV2(self, "Vpc")
114
+ route_table = RouteTable(self, "RouteTable",
115
115
  vpc=my_vpc
116
116
  )
117
- subnet = vpc_v2.SubnetV2(self, "Subnet",
117
+ subnet = SubnetV2(self, "Subnet",
118
118
  vpc=my_vpc,
119
119
  route_table=route_table,
120
120
  availability_zone="eu-west-2a",
121
121
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
122
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
122
+ subnet_type=SubnetType.PRIVATE_ISOLATED
123
123
  )
124
124
  ```
125
125
 
126
- `Route`s can be created to link subnets to various different AWS services via gateways and endpoints. Each unique route target has its own dedicated construct that can be routed to a given subnet via the `Route` construct. An example using the `InternetGateway` construct can be seen below:
126
+ `Routes` can be created to link subnets to various different AWS services via gateways and endpoints. Each unique route target has its own dedicated construct that can be routed to a given subnet via the `Route` construct. An example using the `InternetGateway` construct can be seen below:
127
127
 
128
128
  ```python
129
129
  stack = Stack()
130
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
131
- route_table = vpc_v2.RouteTable(self, "RouteTable",
130
+ my_vpc = VpcV2(self, "Vpc")
131
+ route_table = RouteTable(self, "RouteTable",
132
132
  vpc=my_vpc
133
133
  )
134
- subnet = vpc_v2.SubnetV2(self, "Subnet",
134
+ subnet = SubnetV2(self, "Subnet",
135
135
  vpc=my_vpc,
136
136
  availability_zone="eu-west-2a",
137
137
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
138
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
138
+ subnet_type=SubnetType.PRIVATE_ISOLATED
139
139
  )
140
140
 
141
- igw = vpc_v2.InternetGateway(self, "IGW",
141
+ igw = InternetGateway(self, "IGW",
142
142
  vpc=my_vpc
143
143
  )
144
- vpc_v2.Route(self, "IgwRoute",
144
+ Route(self, "IgwRoute",
145
145
  route_table=route_table,
146
146
  destination="0.0.0.0/0",
147
147
  target={"gateway": igw}
148
148
  )
149
149
  ```
150
150
 
151
+ Alternatively, `Routes` can also be created via method `addRoute` in the `RouteTable` class. An example using the `EgressOnlyInternetGateway` construct can be seen below:
152
+ Note: `EgressOnlyInternetGateway` can only be used to set up outbound IPv6 routing.
153
+
154
+ ```python
155
+ stack = Stack()
156
+ my_vpc = VpcV2(self, "Vpc",
157
+ primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
158
+ secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
159
+ cidr_block_name="AmazonProvided"
160
+ )]
161
+ )
162
+
163
+ eigw = EgressOnlyInternetGateway(self, "EIGW",
164
+ vpc=my_vpc
165
+ )
166
+
167
+ route_table = RouteTable(self, "RouteTable",
168
+ vpc=my_vpc
169
+ )
170
+
171
+ route_table.add_route("EIGW", "::/0", {"gateway": eigw})
172
+ ```
173
+
151
174
  Other route targets may require a deeper set of parameters to set up properly. For instance, the example below illustrates how to set up a `NatGateway`:
152
175
 
153
176
  ```python
154
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
155
- route_table = vpc_v2.RouteTable(self, "RouteTable",
177
+ my_vpc = VpcV2(self, "Vpc")
178
+ route_table = RouteTable(self, "RouteTable",
156
179
  vpc=my_vpc
157
180
  )
158
- subnet = vpc_v2.SubnetV2(self, "Subnet",
181
+ subnet = SubnetV2(self, "Subnet",
159
182
  vpc=my_vpc,
160
183
  availability_zone="eu-west-2a",
161
184
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
162
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
185
+ subnet_type=SubnetType.PRIVATE_ISOLATED
163
186
  )
164
187
 
165
- natgw = vpc_v2.NatGateway(self, "NatGW",
188
+ natgw = NatGateway(self, "NatGW",
166
189
  subnet=subnet,
167
190
  vpc=my_vpc,
168
191
  connectivity_type=NatConnectivityType.PRIVATE,
169
192
  private_ip_address="10.0.0.42"
170
193
  )
171
- vpc_v2.Route(self, "NatGwRoute",
194
+ Route(self, "NatGwRoute",
172
195
  route_table=route_table,
173
196
  destination="0.0.0.0/0",
174
197
  target={"gateway": natgw}
@@ -178,15 +201,16 @@ vpc_v2.Route(self, "NatGwRoute",
178
201
  It is also possible to set up endpoints connecting other AWS services. For instance, the example below illustrates the linking of a Dynamo DB endpoint via the existing `ec2.GatewayVpcEndpoint` construct as a route target:
179
202
 
180
203
  ```python
181
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
182
- route_table = vpc_v2.RouteTable(self, "RouteTable",
204
+ stack = Stack()
205
+ my_vpc = VpcV2(self, "Vpc")
206
+ route_table = RouteTable(self, "RouteTable",
183
207
  vpc=my_vpc
184
208
  )
185
- subnet = vpc_v2.SubnetV2(self, "Subnet",
209
+ subnet = SubnetV2(self, "Subnet",
186
210
  vpc=my_vpc,
187
211
  availability_zone="eu-west-2a",
188
212
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
189
- subnet_type=ec2.SubnetType.PRIVATE
213
+ subnet_type=SubnetType.PRIVATE
190
214
  )
191
215
 
192
216
  dynamo_endpoint = ec2.GatewayVpcEndpoint(self, "DynamoEndpoint",
@@ -194,12 +218,147 @@ dynamo_endpoint = ec2.GatewayVpcEndpoint(self, "DynamoEndpoint",
194
218
  vpc=my_vpc,
195
219
  subnets=[subnet]
196
220
  )
197
- vpc_v2.Route(self, "DynamoDBRoute",
221
+ Route(self, "DynamoDBRoute",
198
222
  route_table=route_table,
199
223
  destination="0.0.0.0/0",
200
224
  target={"endpoint": dynamo_endpoint}
201
225
  )
202
226
  ```
227
+
228
+ ## Adding Egress-Only Internet Gateway to VPC
229
+
230
+ An egress-only internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows outbound communication over IPv6 from instances in your VPC to the internet, and prevents the internet from initiating an IPv6 connection with your instances.
231
+
232
+ For more information see [Enable outbound IPv6 traffic using an egress-only internet gateway](https://docs.aws.amazon.com/vpc/latest/userguide/egress-only-internet-gateway.html).
233
+
234
+ VpcV2 supports adding an egress only internet gateway to VPC using the `addEgressOnlyInternetGateway` method.
235
+
236
+ By default, this method sets up a route to all outbound IPv6 address ranges, unless a specific destination is provided by the user. It can only be configured for IPv6-enabled VPCs.
237
+ The `Subnets` parameter accepts a `SubnetFilter`, which can be based on a `SubnetType` in VpcV2. A new route will be added to the route tables of all subnets that match this filter.
238
+
239
+ ```python
240
+ stack = Stack()
241
+ my_vpc = VpcV2(self, "Vpc",
242
+ primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
243
+ secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
244
+ cidr_block_name="AmazonProvided"
245
+ )]
246
+ )
247
+ route_table = RouteTable(self, "RouteTable",
248
+ vpc=my_vpc
249
+ )
250
+ subnet = SubnetV2(self, "Subnet",
251
+ vpc=my_vpc,
252
+ availability_zone="eu-west-2a",
253
+ ipv4_cidr_block=IpCidr("10.0.0.0/24"),
254
+ ipv6_cidr_block=IpCidr("2001:db8:1::/64"),
255
+ subnet_type=SubnetType.PRIVATE
256
+ )
257
+
258
+ my_vpc.add_egress_only_internet_gateway(
259
+ subnets=[ec2.SubnetSelection(subnet_type=SubnetType.PRIVATE)],
260
+ destination="::/60"
261
+ )
262
+ ```
263
+
264
+ ## Adding NATGateway to the VPC
265
+
266
+ A NAT gateway is a Network Address Translation (NAT) service.You can use a NAT gateway so that instances in a private subnet can connect to services outside your VPC but external services cannot initiate a connection with those instances.
267
+
268
+ For more information, see [NAT gateway basics](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html).
269
+
270
+ When you create a NAT gateway, you specify one of the following connectivity types:
271
+
272
+ **Public – (Default)**: Instances in private subnets can connect to the internet through a public NAT gateway, but cannot receive unsolicited inbound connections from the internet
273
+
274
+ **Private**: Instances in private subnets can connect to other VPCs or your on-premises network through a private NAT gateway.
275
+
276
+ To define the NAT gateway connectivity type as `ConnectivityType.Public`, you need to ensure that there is an IGW(Internet Gateway) attached to the subnet's VPC.
277
+ Since a NATGW is associated with a particular subnet, providing `subnet` field in the input props is mandatory.
278
+
279
+ Additionally, you can set up a route in any route table with the target set to the NAT Gateway. The function `addNatGateway` returns a `NATGateway` object that you can reference later.
280
+
281
+ The code example below provides the definition for adding a NAT gateway to your subnet:
282
+
283
+ ```python
284
+ stack = Stack()
285
+ my_vpc = VpcV2(self, "Vpc")
286
+ route_table = RouteTable(self, "RouteTable",
287
+ vpc=my_vpc
288
+ )
289
+ subnet = SubnetV2(self, "Subnet",
290
+ vpc=my_vpc,
291
+ availability_zone="eu-west-2a",
292
+ ipv4_cidr_block=IpCidr("10.0.0.0/24"),
293
+ subnet_type=SubnetType.PUBLIC
294
+ )
295
+
296
+ my_vpc.add_internet_gateway()
297
+ my_vpc.add_nat_gateway(
298
+ subnet=subnet,
299
+ connectivity_type=NatConnectivityType.PUBLIC
300
+ )
301
+ ```
302
+
303
+ ## Enable VPNGateway for the VPC
304
+
305
+ A virtual private gateway is the endpoint on the VPC side of your VPN connection.
306
+
307
+ For more information, see [What is AWS Site-to-Site VPN?](https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html).
308
+
309
+ VPN route propagation is a feature in Amazon Web Services (AWS) that automatically updates route tables in your Virtual Private Cloud (VPC) with routes learned from a VPN connection.
310
+
311
+ To enable VPN route propogation, use the `vpnRoutePropagation` property to specify the subnets as an input to the function. VPN route propagation will then be enabled for each subnet with the corresponding route table IDs.
312
+
313
+ Additionally, you can set up a route in any route table with the target set to the VPN Gateway. The function `enableVpnGatewayV2` returns a `VPNGatewayV2` object that you can reference later.
314
+
315
+ The code example below provides the definition for setting up a VPN gateway with `vpnRoutePropogation` enabled:
316
+
317
+ ```python
318
+ stack = Stack()
319
+ my_vpc = VpcV2(self, "Vpc")
320
+ vpn_gateway = my_vpc.enable_vpn_gateway_v2(
321
+ vpn_route_propagation=[ec2.SubnetSelection(subnet_type=SubnetType.PUBLIC)],
322
+ type=VpnConnectionType.IPSEC_1
323
+ )
324
+
325
+ route_table = RouteTable(stack, "routeTable",
326
+ vpc=my_vpc
327
+ )
328
+
329
+ Route(stack, "route",
330
+ destination="172.31.0.0/24",
331
+ target={"gateway": vpn_gateway},
332
+ route_table=route_table
333
+ )
334
+ ```
335
+
336
+ ## Adding InternetGateway to the VPC
337
+
338
+ An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet. It supports both IPv4 and IPv6 traffic.
339
+
340
+ For more information, see [Enable VPC internet access using internet gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-igw-internet-access.html).
341
+
342
+ You can add an internet gateway to a VPC using `addInternetGateway` method. By default, this method creates a route in all Public Subnets with outbound destination set to `0.0.0.0` for IPv4 and `::0` for IPv6 enabled VPC.
343
+ Instead of using the default settings, you can configure a custom destinatation range by providing an optional input `destination` to the method.
344
+
345
+ The code example below shows how to add an internet gateway with a custom outbound destination IP range:
346
+
347
+ ```python
348
+ stack = Stack()
349
+ my_vpc = VpcV2(self, "Vpc")
350
+
351
+ subnet = SubnetV2(self, "Subnet",
352
+ vpc=my_vpc,
353
+ availability_zone="eu-west-2a",
354
+ ipv4_cidr_block=IpCidr("10.0.0.0/24"),
355
+ subnet_type=SubnetType.PUBLIC
356
+ )
357
+
358
+ my_vpc.add_internet_gateway(
359
+ ipv4_destination="192.168.0.0/16"
360
+ )
361
+ ```
203
362
  '''
204
363
  from pkgutil import extend_path
205
364
  __path__ = extend_path(__path__, __name__)
@@ -214,7 +373,22 @@ import jsii
214
373
  import publication
215
374
  import typing_extensions
216
375
 
217
- from typeguard import check_type
376
+ import typeguard
377
+ from importlib.metadata import version as _metadata_package_version
378
+ TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
379
+
380
+ def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
381
+ if TYPEGUARD_MAJOR_VERSION <= 2:
382
+ return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
383
+ else:
384
+ if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
385
+ pass
386
+ else:
387
+ if TYPEGUARD_MAJOR_VERSION == 3:
388
+ typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
389
+ typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
390
+ else:
391
+ typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
218
392
 
219
393
  from ._jsii import *
220
394
 
@@ -242,28 +416,28 @@ class AddressFamily(enum.Enum):
242
416
  operating_region=["us-west-1"]
243
417
  )
244
418
  ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
245
- address_family=vpc_v2.AddressFamily.IP_V6,
419
+ address_family=AddressFamily.IP_V6,
246
420
  aws_service=AwsServiceName.EC2,
247
421
  locale="us-west-1",
248
- public_ip_source=vpc_v2.IpamPoolPublicIpSource.AMAZON
422
+ public_ip_source=IpamPoolPublicIpSource.AMAZON
249
423
  )
250
424
  ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
251
425
 
252
426
  ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
253
- address_family=vpc_v2.AddressFamily.IP_V4
427
+ address_family=AddressFamily.IP_V4
254
428
  )
255
429
  ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
256
430
 
257
- vpc_v2.VpcV2(self, "Vpc",
258
- primary_address_block=vpc_v2.IpAddresses.ipv4("10.0.0.0/24"),
431
+ VpcV2(self, "Vpc",
432
+ primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
259
433
  secondary_address_blocks=[
260
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
261
- vpc_v2.IpAddresses.ipv6_ipam(
434
+ IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
435
+ IpAddresses.ipv6_ipam(
262
436
  ipam_pool=ipam_public_pool,
263
437
  netmask_length=52,
264
438
  cidr_block_name="ipv6Ipam"
265
439
  ),
266
- vpc_v2.IpAddresses.ipv4_ipam(
440
+ IpAddresses.ipv4_ipam(
267
441
  ipam_pool=ipam_private_pool,
268
442
  netmask_length=8,
269
443
  cidr_block_name="ipv4Ipam"
@@ -302,6 +476,97 @@ class AwsServiceName(enum.Enum):
302
476
  '''
303
477
 
304
478
 
479
+ @jsii.data_type(
480
+ jsii_type="@aws-cdk/aws-ec2-alpha.EgressOnlyInternetGatewayOptions",
481
+ jsii_struct_bases=[],
482
+ name_mapping={"destination": "destination", "subnets": "subnets"},
483
+ )
484
+ class EgressOnlyInternetGatewayOptions:
485
+ def __init__(
486
+ self,
487
+ *,
488
+ destination: typing.Optional[builtins.str] = None,
489
+ subnets: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
490
+ ) -> None:
491
+ '''(experimental) Options to define EgressOnlyInternetGateway for VPC.
492
+
493
+ :param destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
494
+ :param subnets: (experimental) List of subnets where route to EGW will be added. Default: - no route created
495
+
496
+ :stability: experimental
497
+ :exampleMetadata: infused
498
+
499
+ Example::
500
+
501
+ stack = Stack()
502
+ my_vpc = VpcV2(self, "Vpc",
503
+ primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
504
+ secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
505
+ cidr_block_name="AmazonProvided"
506
+ )]
507
+ )
508
+ route_table = RouteTable(self, "RouteTable",
509
+ vpc=my_vpc
510
+ )
511
+ subnet = SubnetV2(self, "Subnet",
512
+ vpc=my_vpc,
513
+ availability_zone="eu-west-2a",
514
+ ipv4_cidr_block=IpCidr("10.0.0.0/24"),
515
+ ipv6_cidr_block=IpCidr("2001:db8:1::/64"),
516
+ subnet_type=SubnetType.PRIVATE
517
+ )
518
+
519
+ my_vpc.add_egress_only_internet_gateway(
520
+ subnets=[ec2.SubnetSelection(subnet_type=SubnetType.PRIVATE)],
521
+ destination="::/60"
522
+ )
523
+ '''
524
+ if __debug__:
525
+ type_hints = typing.get_type_hints(_typecheckingstub__47cf639398ded64820e35dac43908a70a34ddc76a3ed35cc0c24357b0e01f48d)
526
+ check_type(argname="argument destination", value=destination, expected_type=type_hints["destination"])
527
+ check_type(argname="argument subnets", value=subnets, expected_type=type_hints["subnets"])
528
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
529
+ if destination is not None:
530
+ self._values["destination"] = destination
531
+ if subnets is not None:
532
+ self._values["subnets"] = subnets
533
+
534
+ @builtins.property
535
+ def destination(self) -> typing.Optional[builtins.str]:
536
+ '''(experimental) Destination Ipv6 address for EGW route.
537
+
538
+ :default: - '::/0' all Ipv6 traffic
539
+
540
+ :stability: experimental
541
+ '''
542
+ result = self._values.get("destination")
543
+ return typing.cast(typing.Optional[builtins.str], result)
544
+
545
+ @builtins.property
546
+ def subnets(
547
+ self,
548
+ ) -> typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]]:
549
+ '''(experimental) List of subnets where route to EGW will be added.
550
+
551
+ :default: - no route created
552
+
553
+ :stability: experimental
554
+ '''
555
+ result = self._values.get("subnets")
556
+ return typing.cast(typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]], result)
557
+
558
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
559
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
560
+
561
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
562
+ return not (rhs == self)
563
+
564
+ def __repr__(self) -> str:
565
+ return "EgressOnlyInternetGatewayOptions(%s)" % ", ".join(
566
+ k + "=" + repr(v) for k, v in self._values.items()
567
+ )
568
+
569
+
305
570
  @jsii.data_type(
306
571
  jsii_type="@aws-cdk/aws-ec2-alpha.EgressOnlyInternetGatewayProps",
307
572
  jsii_struct_bases=[],
@@ -320,25 +585,30 @@ class EgressOnlyInternetGatewayProps:
320
585
  '''(experimental) Properties to define an egress-only internet gateway.
321
586
 
322
587
  :param vpc: (experimental) The ID of the VPC for which to create the egress-only internet gateway.
323
- :param egress_only_internet_gateway_name: (experimental) The resource name of the egress-only internet gateway. Default: none
588
+ :param egress_only_internet_gateway_name: (experimental) The resource name of the egress-only internet gateway. Default: - provisioned without a resource name
324
589
 
325
590
  :stability: experimental
326
- :exampleMetadata: fixture=_generated
591
+ :exampleMetadata: infused
327
592
 
328
593
  Example::
329
594
 
330
- # The code below shows an example of how to instantiate this type.
331
- # The values are placeholders you should change.
332
- import aws_cdk.aws_ec2_alpha as ec2_alpha
333
-
334
- # vpc_v2: ec2_alpha.VpcV2
595
+ stack = Stack()
596
+ my_vpc = VpcV2(self, "Vpc",
597
+ primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
598
+ secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
599
+ cidr_block_name="AmazonProvided"
600
+ )]
601
+ )
335
602
 
336
- egress_only_internet_gateway_props = ec2_alpha.EgressOnlyInternetGatewayProps(
337
- vpc=vpc_v2,
603
+ eigw = EgressOnlyInternetGateway(self, "EIGW",
604
+ vpc=my_vpc
605
+ )
338
606
 
339
- # the properties below are optional
340
- egress_only_internet_gateway_name="egressOnlyInternetGatewayName"
607
+ route_table = RouteTable(self, "RouteTable",
608
+ vpc=my_vpc
341
609
  )
610
+
611
+ route_table.add_route("EIGW", "::/0", {"gateway": eigw})
342
612
  '''
343
613
  if __debug__:
344
614
  type_hints = typing.get_type_hints(_typecheckingstub__a1cb0281052a85d3461453c956e87b81e82be05002c1ac33451b382cfcf0ea7e)
@@ -364,7 +634,7 @@ class EgressOnlyInternetGatewayProps:
364
634
  def egress_only_internet_gateway_name(self) -> typing.Optional[builtins.str]:
365
635
  '''(experimental) The resource name of the egress-only internet gateway.
366
636
 
367
- :default: none
637
+ :default: - provisioned without a resource name
368
638
 
369
639
  :stability: experimental
370
640
  '''
@@ -456,8 +726,8 @@ class IIpamPool(typing_extensions.Protocol):
456
726
  '''(experimental) Function to associate a IPv6 address with IPAM pool.
457
727
 
458
728
  :param id: -
459
- :param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default: none
460
- :param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default: none
729
+ :param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default: - pool provisioned without netmask length, need netmask length in this case
730
+ :param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default: - pool provisioned without netmask length, need cidr range in this case
461
731
 
462
732
  :stability: experimental
463
733
  '''
@@ -502,8 +772,8 @@ class _IIpamPoolProxy:
502
772
  '''(experimental) Function to associate a IPv6 address with IPAM pool.
503
773
 
504
774
  :param id: -
505
- :param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default: none
506
- :param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default: none
775
+ :param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default: - pool provisioned without netmask length, need netmask length in this case
776
+ :param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default: - pool provisioned without netmask length, need cidr range in this case
507
777
 
508
778
  :stability: experimental
509
779
  '''
@@ -569,9 +839,9 @@ class IIpamScopeBase(typing_extensions.Protocol):
569
839
 
570
840
  :param id: -
571
841
  :param address_family: (experimental) addressFamily - The address family of the pool (ipv4 or ipv6).
572
- :param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: - No service
842
+ :param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: - required in case of an IPv6, throws an error if not provided.
573
843
  :param ipv4_provisioned_cidrs: (experimental) Information about the CIDRs provisioned to the pool. Default: - No CIDRs are provisioned
574
- :param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region
844
+ :param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region of IPAM
575
845
  :param public_ip_source: (experimental) The IP address source for pools in the public scope. Only used for IPv6 address Only allowed values to this are 'byoip' or 'amazon' Default: amazon
576
846
 
577
847
  :stability: experimental
@@ -629,9 +899,9 @@ class _IIpamScopeBaseProxy:
629
899
 
630
900
  :param id: -
631
901
  :param address_family: (experimental) addressFamily - The address family of the pool (ipv4 or ipv6).
632
- :param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: - No service
902
+ :param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: - required in case of an IPv6, throws an error if not provided.
633
903
  :param ipv4_provisioned_cidrs: (experimental) Information about the CIDRs provisioned to the pool. Default: - No CIDRs are provisioned
634
- :param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region
904
+ :param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region of IPAM
635
905
  :param public_ip_source: (experimental) The IP address source for pools in the public scope. Only used for IPv6 address Only allowed values to this are 'byoip' or 'amazon' Default: amazon
636
906
 
637
907
  :stability: experimental
@@ -654,7 +924,7 @@ typing.cast(typing.Any, IIpamScopeBase).__jsii_proxy_class__ = lambda : _IIpamSc
654
924
 
655
925
 
656
926
  @jsii.interface(jsii_type="@aws-cdk/aws-ec2-alpha.IRouteTarget")
657
- class IRouteTarget(typing_extensions.Protocol):
927
+ class IRouteTarget(_constructs_77d1e7e8.IDependable, typing_extensions.Protocol):
658
928
  '''(experimental) Interface to define a routing target, such as an egress-only internet gateway or VPC endpoint.
659
929
 
660
930
  :stability: experimental
@@ -679,7 +949,9 @@ class IRouteTarget(typing_extensions.Protocol):
679
949
  ...
680
950
 
681
951
 
682
- class _IRouteTargetProxy:
952
+ class _IRouteTargetProxy(
953
+ jsii.proxy_for(_constructs_77d1e7e8.IDependable), # type: ignore[misc]
954
+ ):
683
955
  '''(experimental) Interface to define a routing target, such as an egress-only internet gateway or VPC endpoint.
684
956
 
685
957
  :stability: experimental
@@ -710,7 +982,7 @@ typing.cast(typing.Any, IRouteTarget).__jsii_proxy_class__ = lambda : _IRouteTar
710
982
 
711
983
 
712
984
  @jsii.interface(jsii_type="@aws-cdk/aws-ec2-alpha.IRouteV2")
713
- class IRouteV2(typing_extensions.Protocol):
985
+ class IRouteV2(_aws_cdk_ceddda9d.IResource, typing_extensions.Protocol):
714
986
  '''(experimental) Interface to define a route.
715
987
 
716
988
  :stability: experimental
@@ -748,7 +1020,9 @@ class IRouteV2(typing_extensions.Protocol):
748
1020
  ...
749
1021
 
750
1022
 
751
- class _IRouteV2Proxy:
1023
+ class _IRouteV2Proxy(
1024
+ jsii.proxy_for(_aws_cdk_ceddda9d.IResource), # type: ignore[misc]
1025
+ ):
752
1026
  '''(experimental) Interface to define a route.
753
1027
 
754
1028
  :stability: experimental
@@ -807,6 +1081,16 @@ class ISubnetV2(_aws_cdk_aws_ec2_ceddda9d.ISubnet, typing_extensions.Protocol):
807
1081
  '''
808
1082
  ...
809
1083
 
1084
+ @builtins.property
1085
+ @jsii.member(jsii_name="subnetType")
1086
+ def subnet_type(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.SubnetType]:
1087
+ '''(experimental) The type of subnet (public or private) that this subnet represents.
1088
+
1089
+ :stability: experimental
1090
+ :attribute: SubnetType
1091
+ '''
1092
+ ...
1093
+
810
1094
 
811
1095
  class _ISubnetV2Proxy(
812
1096
  jsii.proxy_for(_aws_cdk_aws_ec2_ceddda9d.ISubnet), # type: ignore[misc]
@@ -827,6 +1111,16 @@ class _ISubnetV2Proxy(
827
1111
  '''
828
1112
  return typing.cast(typing.Optional[builtins.str], jsii.get(self, "ipv6CidrBlock"))
829
1113
 
1114
+ @builtins.property
1115
+ @jsii.member(jsii_name="subnetType")
1116
+ def subnet_type(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.SubnetType]:
1117
+ '''(experimental) The type of subnet (public or private) that this subnet represents.
1118
+
1119
+ :stability: experimental
1120
+ :attribute: SubnetType
1121
+ '''
1122
+ return typing.cast(typing.Optional[_aws_cdk_aws_ec2_ceddda9d.SubnetType], jsii.get(self, "subnetType"))
1123
+
830
1124
  # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
831
1125
  typing.cast(typing.Any, ISubnetV2).__jsii_proxy_class__ = lambda : _ISubnetV2Proxy
832
1126
 
@@ -864,6 +1158,104 @@ class IVpcV2(_aws_cdk_aws_ec2_ceddda9d.IVpc, typing_extensions.Protocol):
864
1158
  '''
865
1159
  ...
866
1160
 
1161
+ @jsii.member(jsii_name="addEgressOnlyInternetGateway")
1162
+ def add_egress_only_internet_gateway(
1163
+ self,
1164
+ *,
1165
+ destination: typing.Optional[builtins.str] = None,
1166
+ subnets: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
1167
+ ) -> None:
1168
+ '''(experimental) Add an Egress only Internet Gateway to current VPC.
1169
+
1170
+ Can only be used for ipv6 enabled VPCs.
1171
+ For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/egress-only-internet-gateway-basics.html}.
1172
+
1173
+ :param destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
1174
+ :param subnets: (experimental) List of subnets where route to EGW will be added. Default: - no route created
1175
+
1176
+ :stability: experimental
1177
+ '''
1178
+ ...
1179
+
1180
+ @jsii.member(jsii_name="addInternetGateway")
1181
+ def add_internet_gateway(
1182
+ self,
1183
+ *,
1184
+ ipv4_destination: typing.Optional[builtins.str] = None,
1185
+ ipv6_destination: typing.Optional[builtins.str] = None,
1186
+ ) -> None:
1187
+ '''(experimental) Adds an Internet Gateway to current VPC.
1188
+
1189
+ For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-igw-internet-access.html}.
1190
+
1191
+ :param ipv4_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '0.0.0.0' all Ipv4 traffic
1192
+ :param ipv6_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
1193
+
1194
+ :default: - defines route for all ipv4('0.0.0.0') and ipv6 addresses('::/0')
1195
+
1196
+ :stability: experimental
1197
+ '''
1198
+ ...
1199
+
1200
+ @jsii.member(jsii_name="addNatGateway")
1201
+ def add_nat_gateway(
1202
+ self,
1203
+ *,
1204
+ subnet: ISubnetV2,
1205
+ allocation_id: typing.Optional[builtins.str] = None,
1206
+ connectivity_type: typing.Optional["NatConnectivityType"] = None,
1207
+ max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
1208
+ nat_gateway_name: typing.Optional[builtins.str] = None,
1209
+ private_ip_address: typing.Optional[builtins.str] = None,
1210
+ secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
1211
+ secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
1212
+ secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
1213
+ ) -> "NatGateway":
1214
+ '''(experimental) Adds a new NAT Gateway to VPC A NAT gateway is a Network Address Translation (NAT) service.
1215
+
1216
+ NAT Gateway Connectivity can be of type ``Public`` or ``Private``.
1217
+ For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html}.
1218
+
1219
+ :param subnet: (experimental) The subnet in which the NAT gateway is located.
1220
+ :param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
1221
+ :param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
1222
+ :param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
1223
+ :param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
1224
+ :param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
1225
+ :param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
1226
+ :param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
1227
+ :param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
1228
+
1229
+ :default: ConnectivityType.Public
1230
+
1231
+ :stability: experimental
1232
+ '''
1233
+ ...
1234
+
1235
+ @jsii.member(jsii_name="enableVpnGatewayV2")
1236
+ def enable_vpn_gateway_v2(
1237
+ self,
1238
+ *,
1239
+ type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
1240
+ amazon_side_asn: typing.Optional[jsii.Number] = None,
1241
+ vpn_gateway_name: typing.Optional[builtins.str] = None,
1242
+ vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
1243
+ ) -> "VPNGatewayV2":
1244
+ '''(experimental) Adds VPN Gateway to VPC and set route propogation.
1245
+
1246
+ For more information, see the {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpngateway.html}.
1247
+
1248
+ :param type: (experimental) The type of VPN connection the virtual private gateway supports.
1249
+ :param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
1250
+ :param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
1251
+ :param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
1252
+
1253
+ :default: - no route propogation
1254
+
1255
+ :stability: experimental
1256
+ '''
1257
+ ...
1258
+
867
1259
 
868
1260
  class _IVpcV2Proxy(
869
1261
  jsii.proxy_for(_aws_cdk_aws_ec2_ceddda9d.IVpc), # type: ignore[misc]
@@ -895,11 +1287,136 @@ class _IVpcV2Proxy(
895
1287
  ) -> typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock]:
896
1288
  '''(experimental) The secondary CIDR blocks associated with the VPC.
897
1289
 
898
- For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-resize}.
1290
+ For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-resize}.
1291
+
1292
+ :stability: experimental
1293
+ '''
1294
+ return typing.cast(typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock], jsii.get(self, "secondaryCidrBlock"))
1295
+
1296
+ @jsii.member(jsii_name="addEgressOnlyInternetGateway")
1297
+ def add_egress_only_internet_gateway(
1298
+ self,
1299
+ *,
1300
+ destination: typing.Optional[builtins.str] = None,
1301
+ subnets: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
1302
+ ) -> None:
1303
+ '''(experimental) Add an Egress only Internet Gateway to current VPC.
1304
+
1305
+ Can only be used for ipv6 enabled VPCs.
1306
+ For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/egress-only-internet-gateway-basics.html}.
1307
+
1308
+ :param destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
1309
+ :param subnets: (experimental) List of subnets where route to EGW will be added. Default: - no route created
1310
+
1311
+ :stability: experimental
1312
+ '''
1313
+ options = EgressOnlyInternetGatewayOptions(
1314
+ destination=destination, subnets=subnets
1315
+ )
1316
+
1317
+ return typing.cast(None, jsii.invoke(self, "addEgressOnlyInternetGateway", [options]))
1318
+
1319
+ @jsii.member(jsii_name="addInternetGateway")
1320
+ def add_internet_gateway(
1321
+ self,
1322
+ *,
1323
+ ipv4_destination: typing.Optional[builtins.str] = None,
1324
+ ipv6_destination: typing.Optional[builtins.str] = None,
1325
+ ) -> None:
1326
+ '''(experimental) Adds an Internet Gateway to current VPC.
1327
+
1328
+ For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-igw-internet-access.html}.
1329
+
1330
+ :param ipv4_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '0.0.0.0' all Ipv4 traffic
1331
+ :param ipv6_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
1332
+
1333
+ :default: - defines route for all ipv4('0.0.0.0') and ipv6 addresses('::/0')
1334
+
1335
+ :stability: experimental
1336
+ '''
1337
+ options = InternetGatewayOptions(
1338
+ ipv4_destination=ipv4_destination, ipv6_destination=ipv6_destination
1339
+ )
1340
+
1341
+ return typing.cast(None, jsii.invoke(self, "addInternetGateway", [options]))
1342
+
1343
+ @jsii.member(jsii_name="addNatGateway")
1344
+ def add_nat_gateway(
1345
+ self,
1346
+ *,
1347
+ subnet: ISubnetV2,
1348
+ allocation_id: typing.Optional[builtins.str] = None,
1349
+ connectivity_type: typing.Optional["NatConnectivityType"] = None,
1350
+ max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
1351
+ nat_gateway_name: typing.Optional[builtins.str] = None,
1352
+ private_ip_address: typing.Optional[builtins.str] = None,
1353
+ secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
1354
+ secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
1355
+ secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
1356
+ ) -> "NatGateway":
1357
+ '''(experimental) Adds a new NAT Gateway to VPC A NAT gateway is a Network Address Translation (NAT) service.
1358
+
1359
+ NAT Gateway Connectivity can be of type ``Public`` or ``Private``.
1360
+ For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html}.
1361
+
1362
+ :param subnet: (experimental) The subnet in which the NAT gateway is located.
1363
+ :param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
1364
+ :param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
1365
+ :param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
1366
+ :param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
1367
+ :param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
1368
+ :param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
1369
+ :param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
1370
+ :param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
1371
+
1372
+ :default: ConnectivityType.Public
1373
+
1374
+ :stability: experimental
1375
+ '''
1376
+ options = NatGatewayOptions(
1377
+ subnet=subnet,
1378
+ allocation_id=allocation_id,
1379
+ connectivity_type=connectivity_type,
1380
+ max_drain_duration=max_drain_duration,
1381
+ nat_gateway_name=nat_gateway_name,
1382
+ private_ip_address=private_ip_address,
1383
+ secondary_allocation_ids=secondary_allocation_ids,
1384
+ secondary_private_ip_address_count=secondary_private_ip_address_count,
1385
+ secondary_private_ip_addresses=secondary_private_ip_addresses,
1386
+ )
1387
+
1388
+ return typing.cast("NatGateway", jsii.invoke(self, "addNatGateway", [options]))
1389
+
1390
+ @jsii.member(jsii_name="enableVpnGatewayV2")
1391
+ def enable_vpn_gateway_v2(
1392
+ self,
1393
+ *,
1394
+ type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
1395
+ amazon_side_asn: typing.Optional[jsii.Number] = None,
1396
+ vpn_gateway_name: typing.Optional[builtins.str] = None,
1397
+ vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
1398
+ ) -> "VPNGatewayV2":
1399
+ '''(experimental) Adds VPN Gateway to VPC and set route propogation.
1400
+
1401
+ For more information, see the {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpngateway.html}.
1402
+
1403
+ :param type: (experimental) The type of VPN connection the virtual private gateway supports.
1404
+ :param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
1405
+ :param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
1406
+ :param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
1407
+
1408
+ :default: - no route propogation
899
1409
 
900
1410
  :stability: experimental
901
1411
  '''
902
- return typing.cast(typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock], jsii.get(self, "secondaryCidrBlock"))
1412
+ options = VPNGatewayV2Options(
1413
+ type=type,
1414
+ amazon_side_asn=amazon_side_asn,
1415
+ vpn_gateway_name=vpn_gateway_name,
1416
+ vpn_route_propagation=vpn_route_propagation,
1417
+ )
1418
+
1419
+ return typing.cast("VPNGatewayV2", jsii.invoke(self, "enableVpnGatewayV2", [options]))
903
1420
 
904
1421
  # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
905
1422
  typing.cast(typing.Any, IVpcV2).__jsii_proxy_class__ = lambda : _IVpcV2Proxy
@@ -920,21 +1437,21 @@ class InternetGateway(
920
1437
  Example::
921
1438
 
922
1439
  stack = Stack()
923
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
924
- route_table = vpc_v2.RouteTable(self, "RouteTable",
1440
+ my_vpc = VpcV2(self, "Vpc")
1441
+ route_table = RouteTable(self, "RouteTable",
925
1442
  vpc=my_vpc
926
1443
  )
927
- subnet = vpc_v2.SubnetV2(self, "Subnet",
1444
+ subnet = SubnetV2(self, "Subnet",
928
1445
  vpc=my_vpc,
929
1446
  availability_zone="eu-west-2a",
930
1447
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
931
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
1448
+ subnet_type=SubnetType.PRIVATE_ISOLATED
932
1449
  )
933
1450
 
934
- igw = vpc_v2.InternetGateway(self, "IGW",
1451
+ igw = InternetGateway(self, "IGW",
935
1452
  vpc=my_vpc
936
1453
  )
937
- vpc_v2.Route(self, "IgwRoute",
1454
+ Route(self, "IgwRoute",
938
1455
  route_table=route_table,
939
1456
  destination="0.0.0.0/0",
940
1457
  target={"gateway": igw}
@@ -953,7 +1470,7 @@ class InternetGateway(
953
1470
  :param scope: -
954
1471
  :param id: -
955
1472
  :param vpc: (experimental) The ID of the VPC for which to create the internet gateway.
956
- :param internet_gateway_name: (experimental) The resource name of the internet gateway. Default: none
1473
+ :param internet_gateway_name: (experimental) The resource name of the internet gateway. Default: - provisioned without a resource name
957
1474
 
958
1475
  :stability: experimental
959
1476
  '''
@@ -1004,6 +1521,89 @@ class InternetGateway(
1004
1521
  return typing.cast(builtins.str, jsii.get(self, "vpcId"))
1005
1522
 
1006
1523
 
1524
+ @jsii.data_type(
1525
+ jsii_type="@aws-cdk/aws-ec2-alpha.InternetGatewayOptions",
1526
+ jsii_struct_bases=[],
1527
+ name_mapping={
1528
+ "ipv4_destination": "ipv4Destination",
1529
+ "ipv6_destination": "ipv6Destination",
1530
+ },
1531
+ )
1532
+ class InternetGatewayOptions:
1533
+ def __init__(
1534
+ self,
1535
+ *,
1536
+ ipv4_destination: typing.Optional[builtins.str] = None,
1537
+ ipv6_destination: typing.Optional[builtins.str] = None,
1538
+ ) -> None:
1539
+ '''(experimental) Options to define InternetGateway for VPC.
1540
+
1541
+ :param ipv4_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '0.0.0.0' all Ipv4 traffic
1542
+ :param ipv6_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
1543
+
1544
+ :stability: experimental
1545
+ :exampleMetadata: infused
1546
+
1547
+ Example::
1548
+
1549
+ stack = Stack()
1550
+ my_vpc = VpcV2(self, "Vpc")
1551
+
1552
+ subnet = SubnetV2(self, "Subnet",
1553
+ vpc=my_vpc,
1554
+ availability_zone="eu-west-2a",
1555
+ ipv4_cidr_block=IpCidr("10.0.0.0/24"),
1556
+ subnet_type=SubnetType.PUBLIC
1557
+ )
1558
+
1559
+ my_vpc.add_internet_gateway(
1560
+ ipv4_destination="192.168.0.0/16"
1561
+ )
1562
+ '''
1563
+ if __debug__:
1564
+ type_hints = typing.get_type_hints(_typecheckingstub__1767be14586e30c26bcd910b9753aae1720568db2bf09fbf8dd100e10ab1fc09)
1565
+ check_type(argname="argument ipv4_destination", value=ipv4_destination, expected_type=type_hints["ipv4_destination"])
1566
+ check_type(argname="argument ipv6_destination", value=ipv6_destination, expected_type=type_hints["ipv6_destination"])
1567
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
1568
+ if ipv4_destination is not None:
1569
+ self._values["ipv4_destination"] = ipv4_destination
1570
+ if ipv6_destination is not None:
1571
+ self._values["ipv6_destination"] = ipv6_destination
1572
+
1573
+ @builtins.property
1574
+ def ipv4_destination(self) -> typing.Optional[builtins.str]:
1575
+ '''(experimental) Destination Ipv6 address for EGW route.
1576
+
1577
+ :default: - '0.0.0.0' all Ipv4 traffic
1578
+
1579
+ :stability: experimental
1580
+ '''
1581
+ result = self._values.get("ipv4_destination")
1582
+ return typing.cast(typing.Optional[builtins.str], result)
1583
+
1584
+ @builtins.property
1585
+ def ipv6_destination(self) -> typing.Optional[builtins.str]:
1586
+ '''(experimental) Destination Ipv6 address for EGW route.
1587
+
1588
+ :default: - '::/0' all Ipv6 traffic
1589
+
1590
+ :stability: experimental
1591
+ '''
1592
+ result = self._values.get("ipv6_destination")
1593
+ return typing.cast(typing.Optional[builtins.str], result)
1594
+
1595
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
1596
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
1597
+
1598
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
1599
+ return not (rhs == self)
1600
+
1601
+ def __repr__(self) -> str:
1602
+ return "InternetGatewayOptions(%s)" % ", ".join(
1603
+ k + "=" + repr(v) for k, v in self._values.items()
1604
+ )
1605
+
1606
+
1007
1607
  @jsii.data_type(
1008
1608
  jsii_type="@aws-cdk/aws-ec2-alpha.InternetGatewayProps",
1009
1609
  jsii_struct_bases=[],
@@ -1019,7 +1619,7 @@ class InternetGatewayProps:
1019
1619
  '''(experimental) Properties to define an internet gateway.
1020
1620
 
1021
1621
  :param vpc: (experimental) The ID of the VPC for which to create the internet gateway.
1022
- :param internet_gateway_name: (experimental) The resource name of the internet gateway. Default: none
1622
+ :param internet_gateway_name: (experimental) The resource name of the internet gateway. Default: - provisioned without a resource name
1023
1623
 
1024
1624
  :stability: experimental
1025
1625
  :exampleMetadata: infused
@@ -1027,21 +1627,21 @@ class InternetGatewayProps:
1027
1627
  Example::
1028
1628
 
1029
1629
  stack = Stack()
1030
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
1031
- route_table = vpc_v2.RouteTable(self, "RouteTable",
1630
+ my_vpc = VpcV2(self, "Vpc")
1631
+ route_table = RouteTable(self, "RouteTable",
1032
1632
  vpc=my_vpc
1033
1633
  )
1034
- subnet = vpc_v2.SubnetV2(self, "Subnet",
1634
+ subnet = SubnetV2(self, "Subnet",
1035
1635
  vpc=my_vpc,
1036
1636
  availability_zone="eu-west-2a",
1037
1637
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
1038
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
1638
+ subnet_type=SubnetType.PRIVATE_ISOLATED
1039
1639
  )
1040
1640
 
1041
- igw = vpc_v2.InternetGateway(self, "IGW",
1641
+ igw = InternetGateway(self, "IGW",
1042
1642
  vpc=my_vpc
1043
1643
  )
1044
- vpc_v2.Route(self, "IgwRoute",
1644
+ Route(self, "IgwRoute",
1045
1645
  route_table=route_table,
1046
1646
  destination="0.0.0.0/0",
1047
1647
  target={"gateway": igw}
@@ -1071,7 +1671,7 @@ class InternetGatewayProps:
1071
1671
  def internet_gateway_name(self) -> typing.Optional[builtins.str]:
1072
1672
  '''(experimental) The resource name of the internet gateway.
1073
1673
 
1074
- :default: none
1674
+ :default: - provisioned without a resource name
1075
1675
 
1076
1676
  :stability: experimental
1077
1677
  '''
@@ -1097,24 +1697,15 @@ class IpAddresses(
1097
1697
  '''(experimental) IpAddress options to define VPC V2.
1098
1698
 
1099
1699
  :stability: experimental
1100
- :exampleMetadata: infused
1700
+ :exampleMetadata: fixture=_generated
1101
1701
 
1102
1702
  Example::
1103
1703
 
1104
- stack = Stack()
1105
- my_vpc = vpc_v2.VpcV2(self, "Vpc",
1106
- secondary_address_blocks=[
1107
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIp")
1108
- ]
1109
- )
1704
+ # The code below shows an example of how to instantiate this type.
1705
+ # The values are placeholders you should change.
1706
+ import aws_cdk.aws_ec2_alpha as ec2_alpha
1110
1707
 
1111
- vpc_v2.SubnetV2(self, "subnetA",
1112
- vpc=my_vpc,
1113
- availability_zone="us-east-1a",
1114
- ipv4_cidr_block=vpc_v2.IpCidr("10.0.0.0/24"),
1115
- ipv6_cidr_block=vpc_v2.IpCidr("2a05:d02c:25:4000::/60"),
1116
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
1117
- )
1708
+ ip_addresses = ec2_alpha.IpAddresses()
1118
1709
  '''
1119
1710
 
1120
1711
  def __init__(self) -> None:
@@ -1170,8 +1761,8 @@ class IpAddresses(
1170
1761
  '''(experimental) An Ipv4 Ipam Pool.
1171
1762
 
1172
1763
  :param cidr_block_name: (experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource.
1173
- :param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: - None
1174
- :param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: - None
1764
+ :param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: - no pool attached to VPC secondary address
1765
+ :param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: - no netmask length for IPAM attached to VPC secondary address
1175
1766
 
1176
1767
  :stability: experimental
1177
1768
  '''
@@ -1195,8 +1786,8 @@ class IpAddresses(
1195
1786
  '''(experimental) An Ipv6 Ipam Pool.
1196
1787
 
1197
1788
  :param cidr_block_name: (experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource.
1198
- :param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: - None
1199
- :param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: - None
1789
+ :param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: - no pool attached to VPC secondary address
1790
+ :param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: - no netmask length for IPAM attached to VPC secondary address
1200
1791
 
1201
1792
  :stability: experimental
1202
1793
  '''
@@ -1218,24 +1809,21 @@ class IpCidr(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/aws-ec2-alpha.IpCidr")
1218
1809
  Example::
1219
1810
 
1220
1811
  stack = Stack()
1221
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
1222
- route_table = vpc_v2.RouteTable(self, "RouteTable",
1812
+ my_vpc = VpcV2(self, "Vpc")
1813
+ route_table = RouteTable(self, "RouteTable",
1223
1814
  vpc=my_vpc
1224
1815
  )
1225
- subnet = vpc_v2.SubnetV2(self, "Subnet",
1816
+ subnet = SubnetV2(self, "Subnet",
1226
1817
  vpc=my_vpc,
1227
1818
  availability_zone="eu-west-2a",
1228
1819
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
1229
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
1820
+ subnet_type=SubnetType.PUBLIC
1230
1821
  )
1231
1822
 
1232
- igw = vpc_v2.InternetGateway(self, "IGW",
1233
- vpc=my_vpc
1234
- )
1235
- vpc_v2.Route(self, "IgwRoute",
1236
- route_table=route_table,
1237
- destination="0.0.0.0/0",
1238
- target={"gateway": igw}
1823
+ my_vpc.add_internet_gateway()
1824
+ my_vpc.add_nat_gateway(
1825
+ subnet=subnet,
1826
+ connectivity_type=NatConnectivityType.PUBLIC
1239
1827
  )
1240
1828
  '''
1241
1829
 
@@ -1279,28 +1867,28 @@ class Ipam(
1279
1867
  operating_region=["us-west-1"]
1280
1868
  )
1281
1869
  ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
1282
- address_family=vpc_v2.AddressFamily.IP_V6,
1870
+ address_family=AddressFamily.IP_V6,
1283
1871
  aws_service=AwsServiceName.EC2,
1284
1872
  locale="us-west-1",
1285
- public_ip_source=vpc_v2.IpamPoolPublicIpSource.AMAZON
1873
+ public_ip_source=IpamPoolPublicIpSource.AMAZON
1286
1874
  )
1287
1875
  ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
1288
1876
 
1289
1877
  ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
1290
- address_family=vpc_v2.AddressFamily.IP_V4
1878
+ address_family=AddressFamily.IP_V4
1291
1879
  )
1292
1880
  ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
1293
1881
 
1294
- vpc_v2.VpcV2(self, "Vpc",
1295
- primary_address_block=vpc_v2.IpAddresses.ipv4("10.0.0.0/24"),
1882
+ VpcV2(self, "Vpc",
1883
+ primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
1296
1884
  secondary_address_blocks=[
1297
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
1298
- vpc_v2.IpAddresses.ipv6_ipam(
1885
+ IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
1886
+ IpAddresses.ipv6_ipam(
1299
1887
  ipam_pool=ipam_public_pool,
1300
1888
  netmask_length=52,
1301
1889
  cidr_block_name="ipv6Ipam"
1302
1890
  ),
1303
- vpc_v2.IpAddresses.ipv4_ipam(
1891
+ IpAddresses.ipv4_ipam(
1304
1892
  ipam_pool=ipam_private_pool,
1305
1893
  netmask_length=8,
1306
1894
  cidr_block_name="ipv4Ipam"
@@ -1320,8 +1908,8 @@ class Ipam(
1320
1908
  '''
1321
1909
  :param scope: -
1322
1910
  :param id: -
1323
- :param ipam_name: (experimental) Name of IPAM that can be used for tagging resource. Default: none
1324
- :param operating_region: (experimental) The operating Regions for an IPAM. Operating Regions are AWS Regions where the IPAM is allowed to manage IP address CIDRs For more information about operating Regions, see `Create an IPAM <https://docs.aws.amazon.com//vpc/latest/ipam/create-ipam.html>`_ in the *Amazon VPC IPAM User Guide* . Default: Stack.region if defined else []
1911
+ :param ipam_name: (experimental) Name of IPAM that can be used for tagging resource. Default: - If no name provided, no tags will be added to the IPAM
1912
+ :param operating_region: (experimental) The operating Regions for an IPAM. Operating Regions are AWS Regions where the IPAM is allowed to manage IP address CIDRs For more information about operating Regions, see `Create an IPAM <https://docs.aws.amazon.com//vpc/latest/ipam/create-ipam.html>`_ in the *Amazon VPC IPAM User Guide* . Default: - Stack.region if defined in the stack
1325
1913
 
1326
1914
  :stability: experimental
1327
1915
  '''
@@ -1345,7 +1933,7 @@ class Ipam(
1345
1933
 
1346
1934
  :param scope: -
1347
1935
  :param id: -
1348
- :param ipam_scope_name: (experimental) IPAM scope name that will be used for tagging. Default: none
1936
+ :param ipam_scope_name: (experimental) IPAM scope name that will be used for tagging. Default: - no tags will be added to the scope
1349
1937
 
1350
1938
  :stability: experimental
1351
1939
  '''
@@ -1432,8 +2020,8 @@ class IpamOptions:
1432
2020
  For more information, see the {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipam.html}.
1433
2021
 
1434
2022
  :param cidr_block_name: (experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource.
1435
- :param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: - None
1436
- :param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: - None
2023
+ :param ipam_pool: (experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam. Default: - no pool attached to VPC secondary address
2024
+ :param netmask_length: (experimental) CIDR Mask for Vpc Only required when using AWS Ipam. Default: - no netmask length for IPAM attached to VPC secondary address
1437
2025
 
1438
2026
  :stability: experimental
1439
2027
  :exampleMetadata: infused
@@ -1445,28 +2033,28 @@ class IpamOptions:
1445
2033
  operating_region=["us-west-1"]
1446
2034
  )
1447
2035
  ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
1448
- address_family=vpc_v2.AddressFamily.IP_V6,
2036
+ address_family=AddressFamily.IP_V6,
1449
2037
  aws_service=AwsServiceName.EC2,
1450
2038
  locale="us-west-1",
1451
- public_ip_source=vpc_v2.IpamPoolPublicIpSource.AMAZON
2039
+ public_ip_source=IpamPoolPublicIpSource.AMAZON
1452
2040
  )
1453
2041
  ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
1454
2042
 
1455
2043
  ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
1456
- address_family=vpc_v2.AddressFamily.IP_V4
2044
+ address_family=AddressFamily.IP_V4
1457
2045
  )
1458
2046
  ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
1459
2047
 
1460
- vpc_v2.VpcV2(self, "Vpc",
1461
- primary_address_block=vpc_v2.IpAddresses.ipv4("10.0.0.0/24"),
2048
+ VpcV2(self, "Vpc",
2049
+ primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
1462
2050
  secondary_address_blocks=[
1463
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
1464
- vpc_v2.IpAddresses.ipv6_ipam(
2051
+ IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
2052
+ IpAddresses.ipv6_ipam(
1465
2053
  ipam_pool=ipam_public_pool,
1466
2054
  netmask_length=52,
1467
2055
  cidr_block_name="ipv6Ipam"
1468
2056
  ),
1469
- vpc_v2.IpAddresses.ipv4_ipam(
2057
+ IpAddresses.ipv4_ipam(
1470
2058
  ipam_pool=ipam_private_pool,
1471
2059
  netmask_length=8,
1472
2060
  cidr_block_name="ipv4Ipam"
@@ -1501,7 +2089,7 @@ class IpamOptions:
1501
2089
  def ipam_pool(self) -> typing.Optional[IIpamPool]:
1502
2090
  '''(experimental) Ipv4 or an Ipv6 IPAM pool Only required when using AWS Ipam.
1503
2091
 
1504
- :default: - None
2092
+ :default: - no pool attached to VPC secondary address
1505
2093
 
1506
2094
  :stability: experimental
1507
2095
  '''
@@ -1512,7 +2100,7 @@ class IpamOptions:
1512
2100
  def netmask_length(self) -> typing.Optional[jsii.Number]:
1513
2101
  '''(experimental) CIDR Mask for Vpc Only required when using AWS Ipam.
1514
2102
 
1515
- :default: - None
2103
+ :default: - no netmask length for IPAM attached to VPC secondary address
1516
2104
 
1517
2105
  :stability: experimental
1518
2106
  '''
@@ -1547,8 +2135,8 @@ class IpamPoolCidrProvisioningOptions:
1547
2135
 
1548
2136
  Used to create a new IpamPoolCidr
1549
2137
 
1550
- :param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default: none
1551
- :param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default: none
2138
+ :param cidr: (experimental) Ipv6 CIDR block for the IPAM pool. Default: - pool provisioned without netmask length, need netmask length in this case
2139
+ :param netmask_length: (experimental) Ipv6 Netmask length for the CIDR. Default: - pool provisioned without netmask length, need cidr range in this case
1552
2140
 
1553
2141
  :see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipampoolcidr.html
1554
2142
  :stability: experimental
@@ -1561,28 +2149,28 @@ class IpamPoolCidrProvisioningOptions:
1561
2149
  operating_region=["us-west-1"]
1562
2150
  )
1563
2151
  ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
1564
- address_family=vpc_v2.AddressFamily.IP_V6,
2152
+ address_family=AddressFamily.IP_V6,
1565
2153
  aws_service=AwsServiceName.EC2,
1566
2154
  locale="us-west-1",
1567
- public_ip_source=vpc_v2.IpamPoolPublicIpSource.AMAZON
2155
+ public_ip_source=IpamPoolPublicIpSource.AMAZON
1568
2156
  )
1569
2157
  ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
1570
2158
 
1571
2159
  ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
1572
- address_family=vpc_v2.AddressFamily.IP_V4
2160
+ address_family=AddressFamily.IP_V4
1573
2161
  )
1574
2162
  ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
1575
2163
 
1576
- vpc_v2.VpcV2(self, "Vpc",
1577
- primary_address_block=vpc_v2.IpAddresses.ipv4("10.0.0.0/24"),
2164
+ VpcV2(self, "Vpc",
2165
+ primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
1578
2166
  secondary_address_blocks=[
1579
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
1580
- vpc_v2.IpAddresses.ipv6_ipam(
2167
+ IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
2168
+ IpAddresses.ipv6_ipam(
1581
2169
  ipam_pool=ipam_public_pool,
1582
2170
  netmask_length=52,
1583
2171
  cidr_block_name="ipv6Ipam"
1584
2172
  ),
1585
- vpc_v2.IpAddresses.ipv4_ipam(
2173
+ IpAddresses.ipv4_ipam(
1586
2174
  ipam_pool=ipam_private_pool,
1587
2175
  netmask_length=8,
1588
2176
  cidr_block_name="ipv4Ipam"
@@ -1604,7 +2192,7 @@ class IpamPoolCidrProvisioningOptions:
1604
2192
  def cidr(self) -> typing.Optional[builtins.str]:
1605
2193
  '''(experimental) Ipv6 CIDR block for the IPAM pool.
1606
2194
 
1607
- :default: none
2195
+ :default: - pool provisioned without netmask length, need netmask length in this case
1608
2196
 
1609
2197
  :stability: experimental
1610
2198
  '''
@@ -1615,7 +2203,7 @@ class IpamPoolCidrProvisioningOptions:
1615
2203
  def netmask_length(self) -> typing.Optional[jsii.Number]:
1616
2204
  '''(experimental) Ipv6 Netmask length for the CIDR.
1617
2205
 
1618
- :default: none
2206
+ :default: - pool provisioned without netmask length, need cidr range in this case
1619
2207
 
1620
2208
  :stability: experimental
1621
2209
  '''
@@ -1651,28 +2239,28 @@ class IpamPoolPublicIpSource(enum.Enum):
1651
2239
  operating_region=["us-west-1"]
1652
2240
  )
1653
2241
  ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
1654
- address_family=vpc_v2.AddressFamily.IP_V6,
2242
+ address_family=AddressFamily.IP_V6,
1655
2243
  aws_service=AwsServiceName.EC2,
1656
2244
  locale="us-west-1",
1657
- public_ip_source=vpc_v2.IpamPoolPublicIpSource.AMAZON
2245
+ public_ip_source=IpamPoolPublicIpSource.AMAZON
1658
2246
  )
1659
2247
  ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
1660
2248
 
1661
2249
  ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
1662
- address_family=vpc_v2.AddressFamily.IP_V4
2250
+ address_family=AddressFamily.IP_V4
1663
2251
  )
1664
2252
  ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
1665
2253
 
1666
- vpc_v2.VpcV2(self, "Vpc",
1667
- primary_address_block=vpc_v2.IpAddresses.ipv4("10.0.0.0/24"),
2254
+ VpcV2(self, "Vpc",
2255
+ primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
1668
2256
  secondary_address_blocks=[
1669
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
1670
- vpc_v2.IpAddresses.ipv6_ipam(
2257
+ IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
2258
+ IpAddresses.ipv6_ipam(
1671
2259
  ipam_pool=ipam_public_pool,
1672
2260
  netmask_length=52,
1673
2261
  cidr_block_name="ipv6Ipam"
1674
2262
  ),
1675
- vpc_v2.IpAddresses.ipv4_ipam(
2263
+ IpAddresses.ipv4_ipam(
1676
2264
  ipam_pool=ipam_private_pool,
1677
2265
  netmask_length=8,
1678
2266
  cidr_block_name="ipv4Ipam"
@@ -1707,8 +2295,8 @@ class IpamProps:
1707
2295
  ) -> None:
1708
2296
  '''(experimental) Options to create a new Ipam in the account.
1709
2297
 
1710
- :param ipam_name: (experimental) Name of IPAM that can be used for tagging resource. Default: none
1711
- :param operating_region: (experimental) The operating Regions for an IPAM. Operating Regions are AWS Regions where the IPAM is allowed to manage IP address CIDRs For more information about operating Regions, see `Create an IPAM <https://docs.aws.amazon.com//vpc/latest/ipam/create-ipam.html>`_ in the *Amazon VPC IPAM User Guide* . Default: Stack.region if defined else []
2298
+ :param ipam_name: (experimental) Name of IPAM that can be used for tagging resource. Default: - If no name provided, no tags will be added to the IPAM
2299
+ :param operating_region: (experimental) The operating Regions for an IPAM. Operating Regions are AWS Regions where the IPAM is allowed to manage IP address CIDRs For more information about operating Regions, see `Create an IPAM <https://docs.aws.amazon.com//vpc/latest/ipam/create-ipam.html>`_ in the *Amazon VPC IPAM User Guide* . Default: - Stack.region if defined in the stack
1712
2300
 
1713
2301
  :stability: experimental
1714
2302
  :exampleMetadata: infused
@@ -1720,28 +2308,28 @@ class IpamProps:
1720
2308
  operating_region=["us-west-1"]
1721
2309
  )
1722
2310
  ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
1723
- address_family=vpc_v2.AddressFamily.IP_V6,
2311
+ address_family=AddressFamily.IP_V6,
1724
2312
  aws_service=AwsServiceName.EC2,
1725
2313
  locale="us-west-1",
1726
- public_ip_source=vpc_v2.IpamPoolPublicIpSource.AMAZON
2314
+ public_ip_source=IpamPoolPublicIpSource.AMAZON
1727
2315
  )
1728
2316
  ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
1729
2317
 
1730
2318
  ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
1731
- address_family=vpc_v2.AddressFamily.IP_V4
2319
+ address_family=AddressFamily.IP_V4
1732
2320
  )
1733
2321
  ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
1734
2322
 
1735
- vpc_v2.VpcV2(self, "Vpc",
1736
- primary_address_block=vpc_v2.IpAddresses.ipv4("10.0.0.0/24"),
2323
+ VpcV2(self, "Vpc",
2324
+ primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
1737
2325
  secondary_address_blocks=[
1738
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
1739
- vpc_v2.IpAddresses.ipv6_ipam(
2326
+ IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
2327
+ IpAddresses.ipv6_ipam(
1740
2328
  ipam_pool=ipam_public_pool,
1741
2329
  netmask_length=52,
1742
2330
  cidr_block_name="ipv6Ipam"
1743
2331
  ),
1744
- vpc_v2.IpAddresses.ipv4_ipam(
2332
+ IpAddresses.ipv4_ipam(
1745
2333
  ipam_pool=ipam_private_pool,
1746
2334
  netmask_length=8,
1747
2335
  cidr_block_name="ipv4Ipam"
@@ -1763,7 +2351,7 @@ class IpamProps:
1763
2351
  def ipam_name(self) -> typing.Optional[builtins.str]:
1764
2352
  '''(experimental) Name of IPAM that can be used for tagging resource.
1765
2353
 
1766
- :default: none
2354
+ :default: - If no name provided, no tags will be added to the IPAM
1767
2355
 
1768
2356
  :stability: experimental
1769
2357
  '''
@@ -1777,7 +2365,7 @@ class IpamProps:
1777
2365
  Operating Regions are AWS Regions where the IPAM is allowed to manage IP address CIDRs
1778
2366
  For more information about operating Regions, see `Create an IPAM <https://docs.aws.amazon.com//vpc/latest/ipam/create-ipam.html>`_ in the *Amazon VPC IPAM User Guide* .
1779
2367
 
1780
- :default: Stack.region if defined else []
2368
+ :default: - Stack.region if defined in the stack
1781
2369
 
1782
2370
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipam.html#cfn-ec2-ipam-operatingregions
1783
2371
  :stability: experimental
@@ -1810,7 +2398,7 @@ class IpamScopeOptions:
1810
2398
  ) -> None:
1811
2399
  '''(experimental) Being used in IPAM class to add pools to default scope created by IPAM.
1812
2400
 
1813
- :param ipam_scope_name: (experimental) IPAM scope name that will be used for tagging. Default: none
2401
+ :param ipam_scope_name: (experimental) IPAM scope name that will be used for tagging. Default: - no tags will be added to the scope
1814
2402
 
1815
2403
  :stability: experimental
1816
2404
  :exampleMetadata: fixture=_generated
@@ -1836,7 +2424,7 @@ class IpamScopeOptions:
1836
2424
  def ipam_scope_name(self) -> typing.Optional[builtins.str]:
1837
2425
  '''(experimental) IPAM scope name that will be used for tagging.
1838
2426
 
1839
- :default: none
2427
+ :default: - no tags will be added to the scope
1840
2428
 
1841
2429
  :stability: experimental
1842
2430
  '''
@@ -1886,24 +2474,24 @@ class NatConnectivityType(enum.Enum):
1886
2474
 
1887
2475
  Example::
1888
2476
 
1889
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
1890
- route_table = vpc_v2.RouteTable(self, "RouteTable",
2477
+ my_vpc = VpcV2(self, "Vpc")
2478
+ route_table = RouteTable(self, "RouteTable",
1891
2479
  vpc=my_vpc
1892
2480
  )
1893
- subnet = vpc_v2.SubnetV2(self, "Subnet",
2481
+ subnet = SubnetV2(self, "Subnet",
1894
2482
  vpc=my_vpc,
1895
2483
  availability_zone="eu-west-2a",
1896
2484
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
1897
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
2485
+ subnet_type=SubnetType.PRIVATE_ISOLATED
1898
2486
  )
1899
2487
 
1900
- natgw = vpc_v2.NatGateway(self, "NatGW",
2488
+ natgw = NatGateway(self, "NatGW",
1901
2489
  subnet=subnet,
1902
2490
  vpc=my_vpc,
1903
2491
  connectivity_type=NatConnectivityType.PRIVATE,
1904
2492
  private_ip_address="10.0.0.42"
1905
2493
  )
1906
- vpc_v2.Route(self, "NatGwRoute",
2494
+ Route(self, "NatGwRoute",
1907
2495
  route_table=route_table,
1908
2496
  destination="0.0.0.0/0",
1909
2497
  target={"gateway": natgw}
@@ -1936,24 +2524,24 @@ class NatGateway(
1936
2524
 
1937
2525
  Example::
1938
2526
 
1939
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
1940
- route_table = vpc_v2.RouteTable(self, "RouteTable",
2527
+ my_vpc = VpcV2(self, "Vpc")
2528
+ route_table = RouteTable(self, "RouteTable",
1941
2529
  vpc=my_vpc
1942
2530
  )
1943
- subnet = vpc_v2.SubnetV2(self, "Subnet",
2531
+ subnet = SubnetV2(self, "Subnet",
1944
2532
  vpc=my_vpc,
1945
2533
  availability_zone="eu-west-2a",
1946
2534
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
1947
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
2535
+ subnet_type=SubnetType.PRIVATE_ISOLATED
1948
2536
  )
1949
2537
 
1950
- natgw = vpc_v2.NatGateway(self, "NatGW",
2538
+ natgw = NatGateway(self, "NatGW",
1951
2539
  subnet=subnet,
1952
2540
  vpc=my_vpc,
1953
2541
  connectivity_type=NatConnectivityType.PRIVATE,
1954
2542
  private_ip_address="10.0.0.42"
1955
2543
  )
1956
- vpc_v2.Route(self, "NatGwRoute",
2544
+ Route(self, "NatGwRoute",
1957
2545
  route_table=route_table,
1958
2546
  destination="0.0.0.0/0",
1959
2547
  target={"gateway": natgw}
@@ -1965,7 +2553,8 @@ class NatGateway(
1965
2553
  scope: _constructs_77d1e7e8.Construct,
1966
2554
  id: builtins.str,
1967
2555
  *,
1968
- subnet: _aws_cdk_aws_ec2_ceddda9d.ISubnet,
2556
+ vpc: typing.Optional[IVpcV2] = None,
2557
+ subnet: ISubnetV2,
1969
2558
  allocation_id: typing.Optional[builtins.str] = None,
1970
2559
  connectivity_type: typing.Optional[NatConnectivityType] = None,
1971
2560
  max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
@@ -1974,96 +2563,317 @@ class NatGateway(
1974
2563
  secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
1975
2564
  secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
1976
2565
  secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
1977
- vpc: typing.Optional[IVpcV2] = None,
1978
2566
  ) -> None:
1979
2567
  '''
1980
2568
  :param scope: -
1981
2569
  :param id: -
2570
+ :param vpc: (experimental) The ID of the VPC in which the NAT gateway is located. Default: - no elastic ip associated, required in case of public connectivity if ``AllocationId`` is not defined
2571
+ :param subnet: (experimental) The subnet in which the NAT gateway is located.
2572
+ :param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
2573
+ :param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
2574
+ :param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
2575
+ :param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
2576
+ :param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
2577
+ :param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
2578
+ :param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
2579
+ :param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
2580
+
2581
+ :stability: experimental
2582
+ '''
2583
+ if __debug__:
2584
+ type_hints = typing.get_type_hints(_typecheckingstub__3204c5cc1ee92d73075b1e2c597a7d7bb9eb73b154f33262369b6b4ac9ec33f4)
2585
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
2586
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
2587
+ props = NatGatewayProps(
2588
+ vpc=vpc,
2589
+ subnet=subnet,
2590
+ allocation_id=allocation_id,
2591
+ connectivity_type=connectivity_type,
2592
+ max_drain_duration=max_drain_duration,
2593
+ nat_gateway_name=nat_gateway_name,
2594
+ private_ip_address=private_ip_address,
2595
+ secondary_allocation_ids=secondary_allocation_ids,
2596
+ secondary_private_ip_address_count=secondary_private_ip_address_count,
2597
+ secondary_private_ip_addresses=secondary_private_ip_addresses,
2598
+ )
2599
+
2600
+ jsii.create(self.__class__, self, [scope, id, props])
2601
+
2602
+ @builtins.property
2603
+ @jsii.member(jsii_name="resource")
2604
+ def resource(self) -> _aws_cdk_aws_ec2_ceddda9d.CfnNatGateway:
2605
+ '''(experimental) The NAT gateway CFN resource.
2606
+
2607
+ :stability: experimental
2608
+ '''
2609
+ return typing.cast(_aws_cdk_aws_ec2_ceddda9d.CfnNatGateway, jsii.get(self, "resource"))
2610
+
2611
+ @builtins.property
2612
+ @jsii.member(jsii_name="routerTargetId")
2613
+ def router_target_id(self) -> builtins.str:
2614
+ '''(experimental) The ID of the route target.
2615
+
2616
+ :stability: experimental
2617
+ '''
2618
+ return typing.cast(builtins.str, jsii.get(self, "routerTargetId"))
2619
+
2620
+ @builtins.property
2621
+ @jsii.member(jsii_name="routerType")
2622
+ def router_type(self) -> _aws_cdk_aws_ec2_ceddda9d.RouterType:
2623
+ '''(experimental) The type of router used in the route.
2624
+
2625
+ :stability: experimental
2626
+ '''
2627
+ return typing.cast(_aws_cdk_aws_ec2_ceddda9d.RouterType, jsii.get(self, "routerType"))
2628
+
2629
+ @builtins.property
2630
+ @jsii.member(jsii_name="connectivityType")
2631
+ def connectivity_type(self) -> typing.Optional[NatConnectivityType]:
2632
+ '''(experimental) Indicates whether the NAT gateway supports public or private connectivity.
2633
+
2634
+ :default: public
2635
+
2636
+ :stability: experimental
2637
+ '''
2638
+ return typing.cast(typing.Optional[NatConnectivityType], jsii.get(self, "connectivityType"))
2639
+
2640
+ @builtins.property
2641
+ @jsii.member(jsii_name="maxDrainDuration")
2642
+ def max_drain_duration(self) -> typing.Optional[_aws_cdk_ceddda9d.Duration]:
2643
+ '''(experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress.
2644
+
2645
+ :default: '350 seconds'
2646
+
2647
+ :stability: experimental
2648
+ '''
2649
+ return typing.cast(typing.Optional[_aws_cdk_ceddda9d.Duration], jsii.get(self, "maxDrainDuration"))
2650
+
2651
+
2652
+ @jsii.data_type(
2653
+ jsii_type="@aws-cdk/aws-ec2-alpha.NatGatewayOptions",
2654
+ jsii_struct_bases=[],
2655
+ name_mapping={
2656
+ "subnet": "subnet",
2657
+ "allocation_id": "allocationId",
2658
+ "connectivity_type": "connectivityType",
2659
+ "max_drain_duration": "maxDrainDuration",
2660
+ "nat_gateway_name": "natGatewayName",
2661
+ "private_ip_address": "privateIpAddress",
2662
+ "secondary_allocation_ids": "secondaryAllocationIds",
2663
+ "secondary_private_ip_address_count": "secondaryPrivateIpAddressCount",
2664
+ "secondary_private_ip_addresses": "secondaryPrivateIpAddresses",
2665
+ },
2666
+ )
2667
+ class NatGatewayOptions:
2668
+ def __init__(
2669
+ self,
2670
+ *,
2671
+ subnet: ISubnetV2,
2672
+ allocation_id: typing.Optional[builtins.str] = None,
2673
+ connectivity_type: typing.Optional[NatConnectivityType] = None,
2674
+ max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
2675
+ nat_gateway_name: typing.Optional[builtins.str] = None,
2676
+ private_ip_address: typing.Optional[builtins.str] = None,
2677
+ secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
2678
+ secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
2679
+ secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
2680
+ ) -> None:
2681
+ '''(experimental) Options to define a NAT gateway.
2682
+
1982
2683
  :param subnet: (experimental) The subnet in which the NAT gateway is located.
1983
- :param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
1984
- :param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: public
1985
- :param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350 seconds
1986
- :param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: none
1987
- :param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned. Default: none
1988
- :param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: none
1989
- :param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: none
1990
- :param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: none
1991
- :param vpc: (experimental) The ID of the VPC in which the NAT gateway is located. Default: none
2684
+ :param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
2685
+ :param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
2686
+ :param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
2687
+ :param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
2688
+ :param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
2689
+ :param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
2690
+ :param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
2691
+ :param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
2692
+
2693
+ :stability: experimental
2694
+ :exampleMetadata: infused
2695
+
2696
+ Example::
2697
+
2698
+ stack = Stack()
2699
+ my_vpc = VpcV2(self, "Vpc")
2700
+ route_table = RouteTable(self, "RouteTable",
2701
+ vpc=my_vpc
2702
+ )
2703
+ subnet = SubnetV2(self, "Subnet",
2704
+ vpc=my_vpc,
2705
+ availability_zone="eu-west-2a",
2706
+ ipv4_cidr_block=IpCidr("10.0.0.0/24"),
2707
+ subnet_type=SubnetType.PUBLIC
2708
+ )
2709
+
2710
+ my_vpc.add_internet_gateway()
2711
+ my_vpc.add_nat_gateway(
2712
+ subnet=subnet,
2713
+ connectivity_type=NatConnectivityType.PUBLIC
2714
+ )
2715
+ '''
2716
+ if __debug__:
2717
+ type_hints = typing.get_type_hints(_typecheckingstub__b95898dda7ef46705953a45c7eea2438b79c93d898a7eb07a91955ee9ff221c7)
2718
+ check_type(argname="argument subnet", value=subnet, expected_type=type_hints["subnet"])
2719
+ check_type(argname="argument allocation_id", value=allocation_id, expected_type=type_hints["allocation_id"])
2720
+ check_type(argname="argument connectivity_type", value=connectivity_type, expected_type=type_hints["connectivity_type"])
2721
+ check_type(argname="argument max_drain_duration", value=max_drain_duration, expected_type=type_hints["max_drain_duration"])
2722
+ check_type(argname="argument nat_gateway_name", value=nat_gateway_name, expected_type=type_hints["nat_gateway_name"])
2723
+ check_type(argname="argument private_ip_address", value=private_ip_address, expected_type=type_hints["private_ip_address"])
2724
+ check_type(argname="argument secondary_allocation_ids", value=secondary_allocation_ids, expected_type=type_hints["secondary_allocation_ids"])
2725
+ check_type(argname="argument secondary_private_ip_address_count", value=secondary_private_ip_address_count, expected_type=type_hints["secondary_private_ip_address_count"])
2726
+ check_type(argname="argument secondary_private_ip_addresses", value=secondary_private_ip_addresses, expected_type=type_hints["secondary_private_ip_addresses"])
2727
+ self._values: typing.Dict[builtins.str, typing.Any] = {
2728
+ "subnet": subnet,
2729
+ }
2730
+ if allocation_id is not None:
2731
+ self._values["allocation_id"] = allocation_id
2732
+ if connectivity_type is not None:
2733
+ self._values["connectivity_type"] = connectivity_type
2734
+ if max_drain_duration is not None:
2735
+ self._values["max_drain_duration"] = max_drain_duration
2736
+ if nat_gateway_name is not None:
2737
+ self._values["nat_gateway_name"] = nat_gateway_name
2738
+ if private_ip_address is not None:
2739
+ self._values["private_ip_address"] = private_ip_address
2740
+ if secondary_allocation_ids is not None:
2741
+ self._values["secondary_allocation_ids"] = secondary_allocation_ids
2742
+ if secondary_private_ip_address_count is not None:
2743
+ self._values["secondary_private_ip_address_count"] = secondary_private_ip_address_count
2744
+ if secondary_private_ip_addresses is not None:
2745
+ self._values["secondary_private_ip_addresses"] = secondary_private_ip_addresses
2746
+
2747
+ @builtins.property
2748
+ def subnet(self) -> ISubnetV2:
2749
+ '''(experimental) The subnet in which the NAT gateway is located.
2750
+
2751
+ :stability: experimental
2752
+ '''
2753
+ result = self._values.get("subnet")
2754
+ assert result is not None, "Required property 'subnet' is missing"
2755
+ return typing.cast(ISubnetV2, result)
2756
+
2757
+ @builtins.property
2758
+ def allocation_id(self) -> typing.Optional[builtins.str]:
2759
+ '''(experimental) AllocationID of Elastic IP address that's associated with the NAT gateway.
2760
+
2761
+ This property is required for a public NAT
2762
+ gateway and cannot be specified with a private NAT gateway.
2763
+
2764
+ :default:
2765
+
2766
+ - attr.allocationID of a new Elastic IP created by default
2767
+ //TODO: ADD L2 for elastic ip
2768
+
2769
+ :stability: experimental
2770
+ '''
2771
+ result = self._values.get("allocation_id")
2772
+ return typing.cast(typing.Optional[builtins.str], result)
2773
+
2774
+ @builtins.property
2775
+ def connectivity_type(self) -> typing.Optional[NatConnectivityType]:
2776
+ '''(experimental) Indicates whether the NAT gateway supports public or private connectivity.
2777
+
2778
+ :default: NatConnectivityType.Public
1992
2779
 
1993
2780
  :stability: experimental
1994
2781
  '''
1995
- if __debug__:
1996
- type_hints = typing.get_type_hints(_typecheckingstub__3204c5cc1ee92d73075b1e2c597a7d7bb9eb73b154f33262369b6b4ac9ec33f4)
1997
- check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
1998
- check_type(argname="argument id", value=id, expected_type=type_hints["id"])
1999
- props = NatGatewayProps(
2000
- subnet=subnet,
2001
- allocation_id=allocation_id,
2002
- connectivity_type=connectivity_type,
2003
- max_drain_duration=max_drain_duration,
2004
- nat_gateway_name=nat_gateway_name,
2005
- private_ip_address=private_ip_address,
2006
- secondary_allocation_ids=secondary_allocation_ids,
2007
- secondary_private_ip_address_count=secondary_private_ip_address_count,
2008
- secondary_private_ip_addresses=secondary_private_ip_addresses,
2009
- vpc=vpc,
2010
- )
2782
+ result = self._values.get("connectivity_type")
2783
+ return typing.cast(typing.Optional[NatConnectivityType], result)
2011
2784
 
2012
- jsii.create(self.__class__, self, [scope, id, props])
2785
+ @builtins.property
2786
+ def max_drain_duration(self) -> typing.Optional[_aws_cdk_ceddda9d.Duration]:
2787
+ '''(experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress.
2788
+
2789
+ :default: 350seconds
2790
+
2791
+ :stability: experimental
2792
+ '''
2793
+ result = self._values.get("max_drain_duration")
2794
+ return typing.cast(typing.Optional[_aws_cdk_ceddda9d.Duration], result)
2013
2795
 
2014
2796
  @builtins.property
2015
- @jsii.member(jsii_name="resource")
2016
- def resource(self) -> _aws_cdk_aws_ec2_ceddda9d.CfnNatGateway:
2017
- '''(experimental) The NAT gateway CFN resource.
2797
+ def nat_gateway_name(self) -> typing.Optional[builtins.str]:
2798
+ '''(experimental) The resource name of the NAT gateway.
2799
+
2800
+ :default: - NATGW provisioned without any name
2018
2801
 
2019
2802
  :stability: experimental
2020
2803
  '''
2021
- return typing.cast(_aws_cdk_aws_ec2_ceddda9d.CfnNatGateway, jsii.get(self, "resource"))
2804
+ result = self._values.get("nat_gateway_name")
2805
+ return typing.cast(typing.Optional[builtins.str], result)
2022
2806
 
2023
2807
  @builtins.property
2024
- @jsii.member(jsii_name="routerTargetId")
2025
- def router_target_id(self) -> builtins.str:
2026
- '''(experimental) The ID of the route target.
2808
+ def private_ip_address(self) -> typing.Optional[builtins.str]:
2809
+ '''(experimental) The private IPv4 address to assign to the NAT gateway.
2810
+
2811
+ :default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
2027
2812
 
2028
2813
  :stability: experimental
2029
2814
  '''
2030
- return typing.cast(builtins.str, jsii.get(self, "routerTargetId"))
2815
+ result = self._values.get("private_ip_address")
2816
+ return typing.cast(typing.Optional[builtins.str], result)
2031
2817
 
2032
2818
  @builtins.property
2033
- @jsii.member(jsii_name="routerType")
2034
- def router_type(self) -> _aws_cdk_aws_ec2_ceddda9d.RouterType:
2035
- '''(experimental) The type of router used in the route.
2819
+ def secondary_allocation_ids(self) -> typing.Optional[typing.List[builtins.str]]:
2820
+ '''(experimental) Secondary EIP allocation IDs.
2036
2821
 
2822
+ :default: - no secondary allocation IDs attached to NATGW
2823
+
2824
+ :see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
2037
2825
  :stability: experimental
2038
2826
  '''
2039
- return typing.cast(_aws_cdk_aws_ec2_ceddda9d.RouterType, jsii.get(self, "routerType"))
2827
+ result = self._values.get("secondary_allocation_ids")
2828
+ return typing.cast(typing.Optional[typing.List[builtins.str]], result)
2040
2829
 
2041
2830
  @builtins.property
2042
- @jsii.member(jsii_name="connectivityType")
2043
- def connectivity_type(self) -> typing.Optional[builtins.str]:
2044
- '''(experimental) Indicates whether the NAT gateway supports public or private connectivity.
2831
+ def secondary_private_ip_address_count(self) -> typing.Optional[jsii.Number]:
2832
+ '''(experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway.
2045
2833
 
2046
- :default: public
2834
+ ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be
2835
+ set at the same time.
2047
2836
 
2837
+ :default: - no secondary allocation IDs associated with NATGW
2838
+
2839
+ :see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
2048
2840
  :stability: experimental
2049
2841
  '''
2050
- return typing.cast(typing.Optional[builtins.str], jsii.get(self, "connectivityType"))
2842
+ result = self._values.get("secondary_private_ip_address_count")
2843
+ return typing.cast(typing.Optional[jsii.Number], result)
2051
2844
 
2052
2845
  @builtins.property
2053
- @jsii.member(jsii_name="maxDrainDuration")
2054
- def max_drain_duration(self) -> typing.Optional[_aws_cdk_ceddda9d.Duration]:
2055
- '''(experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress.
2846
+ def secondary_private_ip_addresses(
2847
+ self,
2848
+ ) -> typing.Optional[typing.List[builtins.str]]:
2849
+ '''(experimental) Secondary private IPv4 addresses.
2850
+
2851
+ ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be
2852
+ set at the same time.
2056
2853
 
2057
- :default: 350 seconds
2854
+ :default: - no secondary private IpAddresses associated with NATGW
2058
2855
 
2856
+ :see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
2059
2857
  :stability: experimental
2060
2858
  '''
2061
- return typing.cast(typing.Optional[_aws_cdk_ceddda9d.Duration], jsii.get(self, "maxDrainDuration"))
2859
+ result = self._values.get("secondary_private_ip_addresses")
2860
+ return typing.cast(typing.Optional[typing.List[builtins.str]], result)
2861
+
2862
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
2863
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
2864
+
2865
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
2866
+ return not (rhs == self)
2867
+
2868
+ def __repr__(self) -> str:
2869
+ return "NatGatewayOptions(%s)" % ", ".join(
2870
+ k + "=" + repr(v) for k, v in self._values.items()
2871
+ )
2062
2872
 
2063
2873
 
2064
2874
  @jsii.data_type(
2065
2875
  jsii_type="@aws-cdk/aws-ec2-alpha.NatGatewayProps",
2066
- jsii_struct_bases=[],
2876
+ jsii_struct_bases=[NatGatewayOptions],
2067
2877
  name_mapping={
2068
2878
  "subnet": "subnet",
2069
2879
  "allocation_id": "allocationId",
@@ -2077,11 +2887,11 @@ class NatGateway(
2077
2887
  "vpc": "vpc",
2078
2888
  },
2079
2889
  )
2080
- class NatGatewayProps:
2890
+ class NatGatewayProps(NatGatewayOptions):
2081
2891
  def __init__(
2082
2892
  self,
2083
2893
  *,
2084
- subnet: _aws_cdk_aws_ec2_ceddda9d.ISubnet,
2894
+ subnet: ISubnetV2,
2085
2895
  allocation_id: typing.Optional[builtins.str] = None,
2086
2896
  connectivity_type: typing.Optional[NatConnectivityType] = None,
2087
2897
  max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
@@ -2095,39 +2905,39 @@ class NatGatewayProps:
2095
2905
  '''(experimental) Properties to define a NAT gateway.
2096
2906
 
2097
2907
  :param subnet: (experimental) The subnet in which the NAT gateway is located.
2098
- :param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
2099
- :param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: public
2100
- :param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350 seconds
2101
- :param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: none
2102
- :param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned. Default: none
2103
- :param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: none
2104
- :param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: none
2105
- :param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: none
2106
- :param vpc: (experimental) The ID of the VPC in which the NAT gateway is located. Default: none
2908
+ :param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
2909
+ :param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
2910
+ :param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
2911
+ :param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
2912
+ :param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
2913
+ :param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
2914
+ :param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
2915
+ :param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
2916
+ :param vpc: (experimental) The ID of the VPC in which the NAT gateway is located. Default: - no elastic ip associated, required in case of public connectivity if ``AllocationId`` is not defined
2107
2917
 
2108
2918
  :stability: experimental
2109
2919
  :exampleMetadata: infused
2110
2920
 
2111
2921
  Example::
2112
2922
 
2113
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
2114
- route_table = vpc_v2.RouteTable(self, "RouteTable",
2923
+ my_vpc = VpcV2(self, "Vpc")
2924
+ route_table = RouteTable(self, "RouteTable",
2115
2925
  vpc=my_vpc
2116
2926
  )
2117
- subnet = vpc_v2.SubnetV2(self, "Subnet",
2927
+ subnet = SubnetV2(self, "Subnet",
2118
2928
  vpc=my_vpc,
2119
2929
  availability_zone="eu-west-2a",
2120
2930
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
2121
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
2931
+ subnet_type=SubnetType.PRIVATE_ISOLATED
2122
2932
  )
2123
2933
 
2124
- natgw = vpc_v2.NatGateway(self, "NatGW",
2934
+ natgw = NatGateway(self, "NatGW",
2125
2935
  subnet=subnet,
2126
2936
  vpc=my_vpc,
2127
2937
  connectivity_type=NatConnectivityType.PRIVATE,
2128
2938
  private_ip_address="10.0.0.42"
2129
2939
  )
2130
- vpc_v2.Route(self, "NatGwRoute",
2940
+ Route(self, "NatGwRoute",
2131
2941
  route_table=route_table,
2132
2942
  destination="0.0.0.0/0",
2133
2943
  target={"gateway": natgw}
@@ -2168,14 +2978,14 @@ class NatGatewayProps:
2168
2978
  self._values["vpc"] = vpc
2169
2979
 
2170
2980
  @builtins.property
2171
- def subnet(self) -> _aws_cdk_aws_ec2_ceddda9d.ISubnet:
2981
+ def subnet(self) -> ISubnetV2:
2172
2982
  '''(experimental) The subnet in which the NAT gateway is located.
2173
2983
 
2174
2984
  :stability: experimental
2175
2985
  '''
2176
2986
  result = self._values.get("subnet")
2177
2987
  assert result is not None, "Required property 'subnet' is missing"
2178
- return typing.cast(_aws_cdk_aws_ec2_ceddda9d.ISubnet, result)
2988
+ return typing.cast(ISubnetV2, result)
2179
2989
 
2180
2990
  @builtins.property
2181
2991
  def allocation_id(self) -> typing.Optional[builtins.str]:
@@ -2186,7 +2996,7 @@ class NatGatewayProps:
2186
2996
 
2187
2997
  :default:
2188
2998
 
2189
- attr.allocationID of a new Elastic IP created by default
2999
+ - attr.allocationID of a new Elastic IP created by default
2190
3000
  //TODO: ADD L2 for elastic ip
2191
3001
 
2192
3002
  :stability: experimental
@@ -2198,7 +3008,7 @@ class NatGatewayProps:
2198
3008
  def connectivity_type(self) -> typing.Optional[NatConnectivityType]:
2199
3009
  '''(experimental) Indicates whether the NAT gateway supports public or private connectivity.
2200
3010
 
2201
- :default: public
3011
+ :default: NatConnectivityType.Public
2202
3012
 
2203
3013
  :stability: experimental
2204
3014
  '''
@@ -2209,7 +3019,7 @@ class NatGatewayProps:
2209
3019
  def max_drain_duration(self) -> typing.Optional[_aws_cdk_ceddda9d.Duration]:
2210
3020
  '''(experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress.
2211
3021
 
2212
- :default: 350 seconds
3022
+ :default: 350seconds
2213
3023
 
2214
3024
  :stability: experimental
2215
3025
  '''
@@ -2220,7 +3030,7 @@ class NatGatewayProps:
2220
3030
  def nat_gateway_name(self) -> typing.Optional[builtins.str]:
2221
3031
  '''(experimental) The resource name of the NAT gateway.
2222
3032
 
2223
- :default: none
3033
+ :default: - NATGW provisioned without any name
2224
3034
 
2225
3035
  :stability: experimental
2226
3036
  '''
@@ -2231,10 +3041,7 @@ class NatGatewayProps:
2231
3041
  def private_ip_address(self) -> typing.Optional[builtins.str]:
2232
3042
  '''(experimental) The private IPv4 address to assign to the NAT gateway.
2233
3043
 
2234
- If you don't provide an
2235
- address, a private IPv4 address will be automatically assigned.
2236
-
2237
- :default: none
3044
+ :default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
2238
3045
 
2239
3046
  :stability: experimental
2240
3047
  '''
@@ -2245,7 +3052,7 @@ class NatGatewayProps:
2245
3052
  def secondary_allocation_ids(self) -> typing.Optional[typing.List[builtins.str]]:
2246
3053
  '''(experimental) Secondary EIP allocation IDs.
2247
3054
 
2248
- :default: none
3055
+ :default: - no secondary allocation IDs attached to NATGW
2249
3056
 
2250
3057
  :see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
2251
3058
  :stability: experimental
@@ -2260,7 +3067,7 @@ class NatGatewayProps:
2260
3067
  ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be
2261
3068
  set at the same time.
2262
3069
 
2263
- :default: none
3070
+ :default: - no secondary allocation IDs associated with NATGW
2264
3071
 
2265
3072
  :see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
2266
3073
  :stability: experimental
@@ -2277,7 +3084,7 @@ class NatGatewayProps:
2277
3084
  ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be
2278
3085
  set at the same time.
2279
3086
 
2280
- :default: none
3087
+ :default: - no secondary private IpAddresses associated with NATGW
2281
3088
 
2282
3089
  :see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating
2283
3090
  :stability: experimental
@@ -2289,7 +3096,7 @@ class NatGatewayProps:
2289
3096
  def vpc(self) -> typing.Optional[IVpcV2]:
2290
3097
  '''(experimental) The ID of the VPC in which the NAT gateway is located.
2291
3098
 
2292
- :default: none
3099
+ :default: - no elastic ip associated, required in case of public connectivity if ``AllocationId`` is not defined
2293
3100
 
2294
3101
  :stability: experimental
2295
3102
  '''
@@ -2332,9 +3139,9 @@ class PoolOptions:
2332
3139
  '''(experimental) Options for configuring an IPAM pool.
2333
3140
 
2334
3141
  :param address_family: (experimental) addressFamily - The address family of the pool (ipv4 or ipv6).
2335
- :param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: - No service
3142
+ :param aws_service: (experimental) Limits which service in AWS that the pool can be used in. "ec2", for example, allows users to use space for Elastic IP addresses and VPCs. Default: - required in case of an IPv6, throws an error if not provided.
2336
3143
  :param ipv4_provisioned_cidrs: (experimental) Information about the CIDRs provisioned to the pool. Default: - No CIDRs are provisioned
2337
- :param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region
3144
+ :param locale: (experimental) The locale (AWS Region) of the pool. Should be one of the IPAM operating region. Only resources in the same Region as the locale of the pool can get IP address allocations from the pool. You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region. Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error. Default: - Current operating region of IPAM
2338
3145
  :param public_ip_source: (experimental) The IP address source for pools in the public scope. Only used for IPv6 address Only allowed values to this are 'byoip' or 'amazon' Default: amazon
2339
3146
 
2340
3147
  :see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipampool.html
@@ -2348,28 +3155,28 @@ class PoolOptions:
2348
3155
  operating_region=["us-west-1"]
2349
3156
  )
2350
3157
  ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
2351
- address_family=vpc_v2.AddressFamily.IP_V6,
3158
+ address_family=AddressFamily.IP_V6,
2352
3159
  aws_service=AwsServiceName.EC2,
2353
3160
  locale="us-west-1",
2354
- public_ip_source=vpc_v2.IpamPoolPublicIpSource.AMAZON
3161
+ public_ip_source=IpamPoolPublicIpSource.AMAZON
2355
3162
  )
2356
3163
  ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
2357
3164
 
2358
3165
  ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
2359
- address_family=vpc_v2.AddressFamily.IP_V4
3166
+ address_family=AddressFamily.IP_V4
2360
3167
  )
2361
3168
  ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
2362
3169
 
2363
- vpc_v2.VpcV2(self, "Vpc",
2364
- primary_address_block=vpc_v2.IpAddresses.ipv4("10.0.0.0/24"),
3170
+ VpcV2(self, "Vpc",
3171
+ primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
2365
3172
  secondary_address_blocks=[
2366
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
2367
- vpc_v2.IpAddresses.ipv6_ipam(
3173
+ IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
3174
+ IpAddresses.ipv6_ipam(
2368
3175
  ipam_pool=ipam_public_pool,
2369
3176
  netmask_length=52,
2370
3177
  cidr_block_name="ipv6Ipam"
2371
3178
  ),
2372
- vpc_v2.IpAddresses.ipv4_ipam(
3179
+ IpAddresses.ipv4_ipam(
2373
3180
  ipam_pool=ipam_private_pool,
2374
3181
  netmask_length=8,
2375
3182
  cidr_block_name="ipv4Ipam"
@@ -2412,7 +3219,7 @@ class PoolOptions:
2412
3219
 
2413
3220
  "ec2", for example, allows users to use space for Elastic IP addresses and VPCs.
2414
3221
 
2415
- :default: - No service
3222
+ :default: - required in case of an IPv6, throws an error if not provided.
2416
3223
 
2417
3224
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipampool.html#cfn-ec2-ipampool-awsservice
2418
3225
  :stability: experimental
@@ -2440,7 +3247,7 @@ class PoolOptions:
2440
3247
  You can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares a locale with the VPC’s Region.
2441
3248
  Note that once you choose a Locale for a pool, you cannot modify it. If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error.
2442
3249
 
2443
- :default: - Current operating region
3250
+ :default: - Current operating region of IPAM
2444
3251
 
2445
3252
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipampool.html#cfn-ec2-ipampool-locale
2446
3253
  :stability: experimental
@@ -2488,24 +3295,24 @@ class Route(
2488
3295
 
2489
3296
  Example::
2490
3297
 
2491
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
2492
- route_table = vpc_v2.RouteTable(self, "RouteTable",
3298
+ my_vpc = VpcV2(self, "Vpc")
3299
+ route_table = RouteTable(self, "RouteTable",
2493
3300
  vpc=my_vpc
2494
3301
  )
2495
- subnet = vpc_v2.SubnetV2(self, "Subnet",
3302
+ subnet = SubnetV2(self, "Subnet",
2496
3303
  vpc=my_vpc,
2497
3304
  availability_zone="eu-west-2a",
2498
3305
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
2499
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
3306
+ subnet_type=SubnetType.PRIVATE_ISOLATED
2500
3307
  )
2501
3308
 
2502
- natgw = vpc_v2.NatGateway(self, "NatGW",
3309
+ natgw = NatGateway(self, "NatGW",
2503
3310
  subnet=subnet,
2504
3311
  vpc=my_vpc,
2505
3312
  connectivity_type=NatConnectivityType.PRIVATE,
2506
3313
  private_ip_address="10.0.0.42"
2507
3314
  )
2508
- vpc_v2.Route(self, "NatGwRoute",
3315
+ Route(self, "NatGwRoute",
2509
3316
  route_table=route_table,
2510
3317
  destination="0.0.0.0/0",
2511
3318
  target={"gateway": natgw}
@@ -2528,7 +3335,7 @@ class Route(
2528
3335
  :param destination: (experimental) The IPv4 or IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
2529
3336
  :param route_table: (experimental) The ID of the route table for the route.
2530
3337
  :param target: (experimental) The gateway or endpoint targeted by the route.
2531
- :param route_name: (experimental) The resource name of the route. Default: none
3338
+ :param route_name: (experimental) The resource name of the route. Default: - provisioned without a route name
2532
3339
 
2533
3340
  :stability: experimental
2534
3341
  '''
@@ -2618,31 +3425,31 @@ class RouteProps:
2618
3425
  :param destination: (experimental) The IPv4 or IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
2619
3426
  :param route_table: (experimental) The ID of the route table for the route.
2620
3427
  :param target: (experimental) The gateway or endpoint targeted by the route.
2621
- :param route_name: (experimental) The resource name of the route. Default: none
3428
+ :param route_name: (experimental) The resource name of the route. Default: - provisioned without a route name
2622
3429
 
2623
3430
  :stability: experimental
2624
3431
  :exampleMetadata: infused
2625
3432
 
2626
3433
  Example::
2627
3434
 
2628
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
2629
- route_table = vpc_v2.RouteTable(self, "RouteTable",
3435
+ my_vpc = VpcV2(self, "Vpc")
3436
+ route_table = RouteTable(self, "RouteTable",
2630
3437
  vpc=my_vpc
2631
3438
  )
2632
- subnet = vpc_v2.SubnetV2(self, "Subnet",
3439
+ subnet = SubnetV2(self, "Subnet",
2633
3440
  vpc=my_vpc,
2634
3441
  availability_zone="eu-west-2a",
2635
3442
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
2636
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
3443
+ subnet_type=SubnetType.PRIVATE_ISOLATED
2637
3444
  )
2638
3445
 
2639
- natgw = vpc_v2.NatGateway(self, "NatGW",
3446
+ natgw = NatGateway(self, "NatGW",
2640
3447
  subnet=subnet,
2641
3448
  vpc=my_vpc,
2642
3449
  connectivity_type=NatConnectivityType.PRIVATE,
2643
3450
  private_ip_address="10.0.0.42"
2644
3451
  )
2645
- vpc_v2.Route(self, "NatGwRoute",
3452
+ Route(self, "NatGwRoute",
2646
3453
  route_table=route_table,
2647
3454
  destination="0.0.0.0/0",
2648
3455
  target={"gateway": natgw}
@@ -2699,7 +3506,7 @@ class RouteProps:
2699
3506
  def route_name(self) -> typing.Optional[builtins.str]:
2700
3507
  '''(experimental) The resource name of the route.
2701
3508
 
2702
- :default: none
3509
+ :default: - provisioned without a route name
2703
3510
 
2704
3511
  :stability: experimental
2705
3512
  '''
@@ -2718,7 +3525,7 @@ class RouteProps:
2718
3525
  )
2719
3526
 
2720
3527
 
2721
- @jsii.implements(_aws_cdk_aws_ec2_ceddda9d.IRouteTable, _constructs_77d1e7e8.IDependable)
3528
+ @jsii.implements(_aws_cdk_aws_ec2_ceddda9d.IRouteTable)
2722
3529
  class RouteTable(
2723
3530
  _aws_cdk_ceddda9d.Resource,
2724
3531
  metaclass=jsii.JSIIMeta,
@@ -2733,24 +3540,20 @@ class RouteTable(
2733
3540
  Example::
2734
3541
 
2735
3542
  stack = Stack()
2736
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
2737
- route_table = vpc_v2.RouteTable(self, "RouteTable",
2738
- vpc=my_vpc
2739
- )
2740
- subnet = vpc_v2.SubnetV2(self, "Subnet",
2741
- vpc=my_vpc,
2742
- availability_zone="eu-west-2a",
2743
- ipv4_cidr_block=IpCidr("10.0.0.0/24"),
2744
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
3543
+ my_vpc = VpcV2(self, "Vpc")
3544
+ vpn_gateway = my_vpc.enable_vpn_gateway_v2(
3545
+ vpn_route_propagation=[ec2.SubnetSelection(subnet_type=SubnetType.PUBLIC)],
3546
+ type=VpnConnectionType.IPSEC_1
2745
3547
  )
2746
3548
 
2747
- igw = vpc_v2.InternetGateway(self, "IGW",
3549
+ route_table = RouteTable(stack, "routeTable",
2748
3550
  vpc=my_vpc
2749
3551
  )
2750
- vpc_v2.Route(self, "IgwRoute",
2751
- route_table=route_table,
2752
- destination="0.0.0.0/0",
2753
- target={"gateway": igw}
3552
+
3553
+ Route(stack, "route",
3554
+ destination="172.31.0.0/24",
3555
+ target={"gateway": vpn_gateway},
3556
+ route_table=route_table
2754
3557
  )
2755
3558
  '''
2756
3559
 
@@ -2766,7 +3569,7 @@ class RouteTable(
2766
3569
  :param scope: -
2767
3570
  :param id: -
2768
3571
  :param vpc: (experimental) The ID of the VPC.
2769
- :param route_table_name: (experimental) The resource name of the route table. Default: none
3572
+ :param route_table_name: (experimental) The resource name of the route table. Default: - provisioned without a route table name
2770
3573
 
2771
3574
  :stability: experimental
2772
3575
  '''
@@ -2778,6 +3581,28 @@ class RouteTable(
2778
3581
 
2779
3582
  jsii.create(self.__class__, self, [scope, id, props])
2780
3583
 
3584
+ @jsii.member(jsii_name="addRoute")
3585
+ def add_route(
3586
+ self,
3587
+ id: builtins.str,
3588
+ destination: builtins.str,
3589
+ target: "RouteTargetType",
3590
+ ) -> None:
3591
+ '''(experimental) Adds a new custom route to the route table.
3592
+
3593
+ :param id: -
3594
+ :param destination: The IPv4 or IPv6 CIDR block used for the destination match.
3595
+ :param target: The gateway or endpoint targeted by the route.
3596
+
3597
+ :stability: experimental
3598
+ '''
3599
+ if __debug__:
3600
+ type_hints = typing.get_type_hints(_typecheckingstub__920d6a12797cd2ad571157da68e37100c7d72b72ff09fd42451a65b73f154dd0)
3601
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
3602
+ check_type(argname="argument destination", value=destination, expected_type=type_hints["destination"])
3603
+ check_type(argname="argument target", value=target, expected_type=type_hints["target"])
3604
+ return typing.cast(None, jsii.invoke(self, "addRoute", [id, destination, target]))
3605
+
2781
3606
  @builtins.property
2782
3607
  @jsii.member(jsii_name="resource")
2783
3608
  def resource(self) -> _aws_cdk_aws_ec2_ceddda9d.CfnRouteTable:
@@ -2812,7 +3637,7 @@ class RouteTableProps:
2812
3637
  '''(experimental) Properties to define a route table.
2813
3638
 
2814
3639
  :param vpc: (experimental) The ID of the VPC.
2815
- :param route_table_name: (experimental) The resource name of the route table. Default: none
3640
+ :param route_table_name: (experimental) The resource name of the route table. Default: - provisioned without a route table name
2816
3641
 
2817
3642
  :stability: experimental
2818
3643
  :exampleMetadata: infused
@@ -2820,24 +3645,20 @@ class RouteTableProps:
2820
3645
  Example::
2821
3646
 
2822
3647
  stack = Stack()
2823
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
2824
- route_table = vpc_v2.RouteTable(self, "RouteTable",
2825
- vpc=my_vpc
2826
- )
2827
- subnet = vpc_v2.SubnetV2(self, "Subnet",
2828
- vpc=my_vpc,
2829
- availability_zone="eu-west-2a",
2830
- ipv4_cidr_block=IpCidr("10.0.0.0/24"),
2831
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
3648
+ my_vpc = VpcV2(self, "Vpc")
3649
+ vpn_gateway = my_vpc.enable_vpn_gateway_v2(
3650
+ vpn_route_propagation=[ec2.SubnetSelection(subnet_type=SubnetType.PUBLIC)],
3651
+ type=VpnConnectionType.IPSEC_1
2832
3652
  )
2833
3653
 
2834
- igw = vpc_v2.InternetGateway(self, "IGW",
3654
+ route_table = RouteTable(stack, "routeTable",
2835
3655
  vpc=my_vpc
2836
3656
  )
2837
- vpc_v2.Route(self, "IgwRoute",
2838
- route_table=route_table,
2839
- destination="0.0.0.0/0",
2840
- target={"gateway": igw}
3657
+
3658
+ Route(stack, "route",
3659
+ destination="172.31.0.0/24",
3660
+ target={"gateway": vpn_gateway},
3661
+ route_table=route_table
2841
3662
  )
2842
3663
  '''
2843
3664
  if __debug__:
@@ -2864,7 +3685,7 @@ class RouteTableProps:
2864
3685
  def route_table_name(self) -> typing.Optional[builtins.str]:
2865
3686
  '''(experimental) The resource name of the route table.
2866
3687
 
2867
- :default: none
3688
+ :default: - provisioned without a route table name
2868
3689
 
2869
3690
  :stability: experimental
2870
3691
  '''
@@ -2897,8 +3718,8 @@ class RouteTargetProps:
2897
3718
  ) -> None:
2898
3719
  '''(experimental) The type of endpoint or gateway being targeted by the route.
2899
3720
 
2900
- :param endpoint: (experimental) The endpoint route target. This is used for targets such as VPC endpoints. Default: none
2901
- :param gateway: (experimental) The gateway route target. This is used for targets such as egress-only internet gateway or VPC peering connection. Default: none
3721
+ :param endpoint: (experimental) The endpoint route target. This is used for targets such as VPC endpoints. Default: - target is not set to an endpoint, in this case a gateway is needed.
3722
+ :param gateway: (experimental) The gateway route target. This is used for targets such as egress-only internet gateway or VPC peering connection. Default: - target is not set to a gateway, in this case an endpoint is needed.
2902
3723
 
2903
3724
  :stability: experimental
2904
3725
  :exampleMetadata: fixture=_generated
@@ -2935,7 +3756,7 @@ class RouteTargetProps:
2935
3756
  This is used for targets such as
2936
3757
  VPC endpoints.
2937
3758
 
2938
- :default: none
3759
+ :default: - target is not set to an endpoint, in this case a gateway is needed.
2939
3760
 
2940
3761
  :stability: experimental
2941
3762
  '''
@@ -2949,7 +3770,7 @@ class RouteTargetProps:
2949
3770
  This is used for targets such as
2950
3771
  egress-only internet gateway or VPC peering connection.
2951
3772
 
2952
- :default: none
3773
+ :default: - target is not set to a gateway, in this case an endpoint is needed.
2953
3774
 
2954
3775
  :stability: experimental
2955
3776
  '''
@@ -2979,27 +3800,25 @@ class RouteTargetType(
2979
3800
 
2980
3801
  Example::
2981
3802
 
2982
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
2983
- route_table = vpc_v2.RouteTable(self, "RouteTable",
3803
+ stack = Stack()
3804
+ my_vpc = VpcV2(self, "Vpc")
3805
+ route_table = RouteTable(self, "RouteTable",
2984
3806
  vpc=my_vpc
2985
3807
  )
2986
- subnet = vpc_v2.SubnetV2(self, "Subnet",
3808
+ subnet = SubnetV2(self, "Subnet",
2987
3809
  vpc=my_vpc,
2988
3810
  availability_zone="eu-west-2a",
2989
3811
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
2990
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
3812
+ subnet_type=SubnetType.PRIVATE_ISOLATED
2991
3813
  )
2992
3814
 
2993
- natgw = vpc_v2.NatGateway(self, "NatGW",
2994
- subnet=subnet,
2995
- vpc=my_vpc,
2996
- connectivity_type=NatConnectivityType.PRIVATE,
2997
- private_ip_address="10.0.0.42"
3815
+ igw = InternetGateway(self, "IGW",
3816
+ vpc=my_vpc
2998
3817
  )
2999
- vpc_v2.Route(self, "NatGwRoute",
3818
+ Route(self, "IgwRoute",
3000
3819
  route_table=route_table,
3001
3820
  destination="0.0.0.0/0",
3002
- target={"gateway": natgw}
3821
+ target={"gateway": igw}
3003
3822
  )
3004
3823
  '''
3005
3824
 
@@ -3010,8 +3829,8 @@ class RouteTargetType(
3010
3829
  gateway: typing.Optional[IRouteTarget] = None,
3011
3830
  ) -> None:
3012
3831
  '''
3013
- :param endpoint: (experimental) The endpoint route target. This is used for targets such as VPC endpoints. Default: none
3014
- :param gateway: (experimental) The gateway route target. This is used for targets such as egress-only internet gateway or VPC peering connection. Default: none
3832
+ :param endpoint: (experimental) The endpoint route target. This is used for targets such as VPC endpoints. Default: - target is not set to an endpoint, in this case a gateway is needed.
3833
+ :param gateway: (experimental) The gateway route target. This is used for targets such as egress-only internet gateway or VPC peering connection. Default: - target is not set to a gateway, in this case an endpoint is needed.
3015
3834
 
3016
3835
  :stability: experimental
3017
3836
  '''
@@ -3027,7 +3846,7 @@ class RouteTargetType(
3027
3846
  This is used for targets such as
3028
3847
  VPC endpoints.
3029
3848
 
3030
- :default: none
3849
+ :default: - target is not set to an endpoint, in this case a gateway is needed.
3031
3850
 
3032
3851
  :stability: experimental
3033
3852
  '''
@@ -3041,7 +3860,7 @@ class RouteTargetType(
3041
3860
  This is used for targets such as
3042
3861
  egress-only internet gateway or VPC peering connection.
3043
3862
 
3044
- :default: none
3863
+ :default: - target is not set to a gateway, in this case an endpoint is needed.
3045
3864
 
3046
3865
  :stability: experimental
3047
3866
  '''
@@ -3065,19 +3884,22 @@ class SecondaryAddressProps:
3065
3884
  Example::
3066
3885
 
3067
3886
  stack = Stack()
3068
- my_vpc = vpc_v2.VpcV2(self, "Vpc",
3069
- secondary_address_blocks=[
3070
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIp")
3071
- ]
3887
+ my_vpc = VpcV2(self, "Vpc",
3888
+ primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
3889
+ secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
3890
+ cidr_block_name="AmazonProvided"
3891
+ )]
3072
3892
  )
3073
3893
 
3074
- vpc_v2.SubnetV2(self, "subnetA",
3075
- vpc=my_vpc,
3076
- availability_zone="us-east-1a",
3077
- ipv4_cidr_block=vpc_v2.IpCidr("10.0.0.0/24"),
3078
- ipv6_cidr_block=vpc_v2.IpCidr("2a05:d02c:25:4000::/60"),
3079
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
3894
+ eigw = EgressOnlyInternetGateway(self, "EIGW",
3895
+ vpc=my_vpc
3896
+ )
3897
+
3898
+ route_table = RouteTable(self, "RouteTable",
3899
+ vpc=my_vpc
3080
3900
  )
3901
+
3902
+ route_table.add_route("EIGW", "::/0", {"gateway": eigw})
3081
3903
  '''
3082
3904
  if __debug__:
3083
3905
  type_hints = typing.get_type_hints(_typecheckingstub__9433843cde495b2d9551feec9fd15a488c151e944cfd2262b5fc2613ca397870)
@@ -3129,24 +3951,21 @@ class SubnetV2(
3129
3951
  Example::
3130
3952
 
3131
3953
  stack = Stack()
3132
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
3133
- route_table = vpc_v2.RouteTable(self, "RouteTable",
3954
+ my_vpc = VpcV2(self, "Vpc")
3955
+ route_table = RouteTable(self, "RouteTable",
3134
3956
  vpc=my_vpc
3135
3957
  )
3136
- subnet = vpc_v2.SubnetV2(self, "Subnet",
3958
+ subnet = SubnetV2(self, "Subnet",
3137
3959
  vpc=my_vpc,
3138
3960
  availability_zone="eu-west-2a",
3139
3961
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
3140
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
3962
+ subnet_type=SubnetType.PUBLIC
3141
3963
  )
3142
3964
 
3143
- igw = vpc_v2.InternetGateway(self, "IGW",
3144
- vpc=my_vpc
3145
- )
3146
- vpc_v2.Route(self, "IgwRoute",
3147
- route_table=route_table,
3148
- destination="0.0.0.0/0",
3149
- target={"gateway": igw}
3965
+ my_vpc.add_internet_gateway()
3966
+ my_vpc.add_nat_gateway(
3967
+ subnet=subnet,
3968
+ connectivity_type=NatConnectivityType.PUBLIC
3150
3969
  )
3151
3970
  '''
3152
3971
 
@@ -3172,10 +3991,10 @@ class SubnetV2(
3172
3991
  :param ipv4_cidr_block: (experimental) ipv4 cidr to assign to this subnet. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-cidrblock
3173
3992
  :param subnet_type: (experimental) The type of Subnet to configure. The Subnet type will control the ability to route and connect to the Internet. TODO: Add validation check ``subnetType`` when adding resources (e.g. cannot add NatGateway to private)
3174
3993
  :param vpc: (experimental) VPC Prop.
3175
- :param assign_ipv6_address_on_creation: (experimental) Indicates whether a network interface created in this subnet receives an IPv6 address. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock. Default: false
3176
- :param ipv6_cidr_block: (experimental) Ipv6 CIDR Range for subnet. Default: No Ipv6 address
3177
- :param route_table: (experimental) Custom Route for subnet. Default: Default route table
3178
- :param subnet_name: (experimental) Subnet name. Default: none
3994
+ :param assign_ipv6_address_on_creation: (experimental) Indicates whether a network interface created in this subnet receives an IPv6 address. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock. Default: - undefined in case not provided as an input
3995
+ :param ipv6_cidr_block: (experimental) Ipv6 CIDR Range for subnet. Default: - No Ipv6 address
3996
+ :param route_table: (experimental) Custom Route for subnet. Default: - a default route table created
3997
+ :param subnet_name: (experimental) Subnet name. Default: - provisioned with an autogenerated name by CDK
3179
3998
 
3180
3999
  :stability: experimental
3181
4000
  '''
@@ -3254,7 +4073,7 @@ class SubnetV2(
3254
4073
  @builtins.property
3255
4074
  @jsii.member(jsii_name="routeTable")
3256
4075
  def route_table(self) -> _aws_cdk_aws_ec2_ceddda9d.IRouteTable:
3257
- '''(experimental) The route table for this subnet.
4076
+ '''(experimental) Return the Route Table associated with this subnet.
3258
4077
 
3259
4078
  :stability: experimental
3260
4079
  '''
@@ -3271,23 +4090,23 @@ class SubnetV2(
3271
4090
  return typing.cast(builtins.str, jsii.get(self, "subnetId"))
3272
4091
 
3273
4092
  @builtins.property
3274
- @jsii.member(jsii_name="subnetType")
3275
- def subnet_type(self) -> _aws_cdk_aws_ec2_ceddda9d.SubnetType:
3276
- '''(experimental) The type of subnet (public or private) that this subnet represents.
4093
+ @jsii.member(jsii_name="ipv6CidrBlock")
4094
+ def ipv6_cidr_block(self) -> typing.Optional[builtins.str]:
4095
+ '''(experimental) The IPv6 CIDR Block for this subnet.
3277
4096
 
3278
4097
  :stability: experimental
3279
- :attribute: SubnetType
3280
4098
  '''
3281
- return typing.cast(_aws_cdk_aws_ec2_ceddda9d.SubnetType, jsii.get(self, "subnetType"))
4099
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "ipv6CidrBlock"))
3282
4100
 
3283
4101
  @builtins.property
3284
- @jsii.member(jsii_name="ipv6CidrBlock")
3285
- def ipv6_cidr_block(self) -> typing.Optional[builtins.str]:
3286
- '''(experimental) The IPv6 CIDR Block for this subnet.
4102
+ @jsii.member(jsii_name="subnetType")
4103
+ def subnet_type(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.SubnetType]:
4104
+ '''(experimental) The type of subnet (public or private) that this subnet represents.
3287
4105
 
3288
4106
  :stability: experimental
4107
+ :attribute: SubnetType
3289
4108
  '''
3290
- return typing.cast(typing.Optional[builtins.str], jsii.get(self, "ipv6CidrBlock"))
4109
+ return typing.cast(typing.Optional[_aws_cdk_aws_ec2_ceddda9d.SubnetType], jsii.get(self, "subnetType"))
3291
4110
 
3292
4111
 
3293
4112
  @jsii.data_type(
@@ -3323,10 +4142,10 @@ class SubnetV2Props:
3323
4142
  :param ipv4_cidr_block: (experimental) ipv4 cidr to assign to this subnet. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-cidrblock
3324
4143
  :param subnet_type: (experimental) The type of Subnet to configure. The Subnet type will control the ability to route and connect to the Internet. TODO: Add validation check ``subnetType`` when adding resources (e.g. cannot add NatGateway to private)
3325
4144
  :param vpc: (experimental) VPC Prop.
3326
- :param assign_ipv6_address_on_creation: (experimental) Indicates whether a network interface created in this subnet receives an IPv6 address. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock. Default: false
3327
- :param ipv6_cidr_block: (experimental) Ipv6 CIDR Range for subnet. Default: No Ipv6 address
3328
- :param route_table: (experimental) Custom Route for subnet. Default: Default route table
3329
- :param subnet_name: (experimental) Subnet name. Default: none
4145
+ :param assign_ipv6_address_on_creation: (experimental) Indicates whether a network interface created in this subnet receives an IPv6 address. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock. Default: - undefined in case not provided as an input
4146
+ :param ipv6_cidr_block: (experimental) Ipv6 CIDR Range for subnet. Default: - No Ipv6 address
4147
+ :param route_table: (experimental) Custom Route for subnet. Default: - a default route table created
4148
+ :param subnet_name: (experimental) Subnet name. Default: - provisioned with an autogenerated name by CDK
3330
4149
 
3331
4150
  :stability: experimental
3332
4151
  :exampleMetadata: infused
@@ -3334,24 +4153,21 @@ class SubnetV2Props:
3334
4153
  Example::
3335
4154
 
3336
4155
  stack = Stack()
3337
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
3338
- route_table = vpc_v2.RouteTable(self, "RouteTable",
4156
+ my_vpc = VpcV2(self, "Vpc")
4157
+ route_table = RouteTable(self, "RouteTable",
3339
4158
  vpc=my_vpc
3340
4159
  )
3341
- subnet = vpc_v2.SubnetV2(self, "Subnet",
4160
+ subnet = SubnetV2(self, "Subnet",
3342
4161
  vpc=my_vpc,
3343
4162
  availability_zone="eu-west-2a",
3344
4163
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
3345
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
4164
+ subnet_type=SubnetType.PUBLIC
3346
4165
  )
3347
4166
 
3348
- igw = vpc_v2.InternetGateway(self, "IGW",
3349
- vpc=my_vpc
3350
- )
3351
- vpc_v2.Route(self, "IgwRoute",
3352
- route_table=route_table,
3353
- destination="0.0.0.0/0",
3354
- target={"gateway": igw}
4167
+ my_vpc.add_internet_gateway()
4168
+ my_vpc.add_nat_gateway(
4169
+ subnet=subnet,
4170
+ connectivity_type=NatConnectivityType.PUBLIC
3355
4171
  )
3356
4172
  '''
3357
4173
  if __debug__:
@@ -3432,7 +4248,7 @@ class SubnetV2Props:
3432
4248
 
3433
4249
  If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.
3434
4250
 
3435
- :default: false
4251
+ :default: - undefined in case not provided as an input
3436
4252
 
3437
4253
  :stability: experimental
3438
4254
  '''
@@ -3443,7 +4259,7 @@ class SubnetV2Props:
3443
4259
  def ipv6_cidr_block(self) -> typing.Optional[IpCidr]:
3444
4260
  '''(experimental) Ipv6 CIDR Range for subnet.
3445
4261
 
3446
- :default: No Ipv6 address
4262
+ :default: - No Ipv6 address
3447
4263
 
3448
4264
  :stability: experimental
3449
4265
  '''
@@ -3454,7 +4270,7 @@ class SubnetV2Props:
3454
4270
  def route_table(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IRouteTable]:
3455
4271
  '''(experimental) Custom Route for subnet.
3456
4272
 
3457
- :default: Default route table
4273
+ :default: - a default route table created
3458
4274
 
3459
4275
  :stability: experimental
3460
4276
  '''
@@ -3465,7 +4281,7 @@ class SubnetV2Props:
3465
4281
  def subnet_name(self) -> typing.Optional[builtins.str]:
3466
4282
  '''(experimental) Subnet name.
3467
4283
 
3468
- :default: none
4284
+ :default: - provisioned with an autogenerated name by CDK
3469
4285
 
3470
4286
  :stability: experimental
3471
4287
  '''
@@ -3485,33 +4301,34 @@ class SubnetV2Props:
3485
4301
 
3486
4302
 
3487
4303
  @jsii.implements(IRouteTarget)
3488
- class VPNGateway(
4304
+ class VPNGatewayV2(
3489
4305
  _aws_cdk_ceddda9d.Resource,
3490
4306
  metaclass=jsii.JSIIMeta,
3491
- jsii_type="@aws-cdk/aws-ec2-alpha.VPNGateway",
4307
+ jsii_type="@aws-cdk/aws-ec2-alpha.VPNGatewayV2",
3492
4308
  ):
3493
4309
  '''(experimental) Creates a virtual private gateway.
3494
4310
 
3495
4311
  :stability: experimental
3496
4312
  :resource: AWS::EC2::VPNGateway
3497
- :exampleMetadata: fixture=_generated
4313
+ :exampleMetadata: infused
3498
4314
 
3499
4315
  Example::
3500
4316
 
3501
- # The code below shows an example of how to instantiate this type.
3502
- # The values are placeholders you should change.
3503
- import aws_cdk.aws_ec2_alpha as ec2_alpha
3504
- from aws_cdk import aws_ec2 as ec2
3505
-
3506
- # vpc_v2: ec2_alpha.VpcV2
4317
+ stack = Stack()
4318
+ my_vpc = VpcV2(self, "Vpc")
4319
+ vpn_gateway = my_vpc.enable_vpn_gateway_v2(
4320
+ vpn_route_propagation=[ec2.SubnetSelection(subnet_type=SubnetType.PUBLIC)],
4321
+ type=VpnConnectionType.IPSEC_1
4322
+ )
3507
4323
 
3508
- v_pNGateway = ec2_alpha.VPNGateway(self, "MyVPNGateway",
3509
- type=ec2.VpnConnectionType.IPSEC_1,
3510
- vpc=vpc_v2,
4324
+ route_table = RouteTable(stack, "routeTable",
4325
+ vpc=my_vpc
4326
+ )
3511
4327
 
3512
- # the properties below are optional
3513
- amazon_side_asn=123,
3514
- vpn_gateway_name="vpnGatewayName"
4328
+ Route(stack, "route",
4329
+ destination="172.31.0.0/24",
4330
+ target={"gateway": vpn_gateway},
4331
+ route_table=route_table
3515
4332
  )
3516
4333
  '''
3517
4334
 
@@ -3520,96 +4337,224 @@ class VPNGateway(
3520
4337
  scope: _constructs_77d1e7e8.Construct,
3521
4338
  id: builtins.str,
3522
4339
  *,
3523
- type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
3524
4340
  vpc: IVpcV2,
4341
+ type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
3525
4342
  amazon_side_asn: typing.Optional[jsii.Number] = None,
3526
4343
  vpn_gateway_name: typing.Optional[builtins.str] = None,
4344
+ vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
3527
4345
  ) -> None:
3528
4346
  '''
3529
4347
  :param scope: -
3530
4348
  :param id: -
3531
- :param type: (experimental) The type of VPN connection the virtual private gateway supports.
3532
4349
  :param vpc: (experimental) The ID of the VPC for which to create the VPN gateway.
3533
- :param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: none
3534
- :param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: none
4350
+ :param type: (experimental) The type of VPN connection the virtual private gateway supports.
4351
+ :param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
4352
+ :param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
4353
+ :param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
3535
4354
 
3536
4355
  :stability: experimental
3537
4356
  '''
3538
4357
  if __debug__:
3539
- type_hints = typing.get_type_hints(_typecheckingstub__f6669efe999b4d7fb070da87ce4f6945c7b3b900d1c035c2e7a3dbb26415c28f)
4358
+ type_hints = typing.get_type_hints(_typecheckingstub__99ebb03388deee94929850a6302ea70455c70b08fdbc048c0ad431df4f5d7bff)
3540
4359
  check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
3541
4360
  check_type(argname="argument id", value=id, expected_type=type_hints["id"])
3542
- props = VPNGatewayProps(
3543
- type=type,
4361
+ props = VPNGatewayV2Props(
3544
4362
  vpc=vpc,
4363
+ type=type,
3545
4364
  amazon_side_asn=amazon_side_asn,
3546
4365
  vpn_gateway_name=vpn_gateway_name,
4366
+ vpn_route_propagation=vpn_route_propagation,
3547
4367
  )
3548
4368
 
3549
4369
  jsii.create(self.__class__, self, [scope, id, props])
3550
4370
 
3551
4371
  @builtins.property
3552
- @jsii.member(jsii_name="resource")
3553
- def resource(self) -> _aws_cdk_aws_ec2_ceddda9d.CfnVPNGateway:
3554
- '''(experimental) The VPN gateway CFN resource.
4372
+ @jsii.member(jsii_name="resource")
4373
+ def resource(self) -> _aws_cdk_aws_ec2_ceddda9d.CfnVPNGateway:
4374
+ '''(experimental) The VPN gateway CFN resource.
4375
+
4376
+ :stability: experimental
4377
+ '''
4378
+ return typing.cast(_aws_cdk_aws_ec2_ceddda9d.CfnVPNGateway, jsii.get(self, "resource"))
4379
+
4380
+ @builtins.property
4381
+ @jsii.member(jsii_name="routerTargetId")
4382
+ def router_target_id(self) -> builtins.str:
4383
+ '''(experimental) The ID of the route target.
4384
+
4385
+ :stability: experimental
4386
+ '''
4387
+ return typing.cast(builtins.str, jsii.get(self, "routerTargetId"))
4388
+
4389
+ @builtins.property
4390
+ @jsii.member(jsii_name="routerType")
4391
+ def router_type(self) -> _aws_cdk_aws_ec2_ceddda9d.RouterType:
4392
+ '''(experimental) The type of router used in the route.
4393
+
4394
+ :stability: experimental
4395
+ '''
4396
+ return typing.cast(_aws_cdk_aws_ec2_ceddda9d.RouterType, jsii.get(self, "routerType"))
4397
+
4398
+ @builtins.property
4399
+ @jsii.member(jsii_name="vpcId")
4400
+ def vpc_id(self) -> builtins.str:
4401
+ '''(experimental) The ID of the VPC for which to create the VPN gateway.
4402
+
4403
+ :stability: experimental
4404
+ '''
4405
+ return typing.cast(builtins.str, jsii.get(self, "vpcId"))
4406
+
4407
+
4408
+ @jsii.data_type(
4409
+ jsii_type="@aws-cdk/aws-ec2-alpha.VPNGatewayV2Options",
4410
+ jsii_struct_bases=[],
4411
+ name_mapping={
4412
+ "type": "type",
4413
+ "amazon_side_asn": "amazonSideAsn",
4414
+ "vpn_gateway_name": "vpnGatewayName",
4415
+ "vpn_route_propagation": "vpnRoutePropagation",
4416
+ },
4417
+ )
4418
+ class VPNGatewayV2Options:
4419
+ def __init__(
4420
+ self,
4421
+ *,
4422
+ type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
4423
+ amazon_side_asn: typing.Optional[jsii.Number] = None,
4424
+ vpn_gateway_name: typing.Optional[builtins.str] = None,
4425
+ vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
4426
+ ) -> None:
4427
+ '''(experimental) Options to define VPNGatewayV2 for VPC.
4428
+
4429
+ :param type: (experimental) The type of VPN connection the virtual private gateway supports.
4430
+ :param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
4431
+ :param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
4432
+ :param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
4433
+
4434
+ :stability: experimental
4435
+ :exampleMetadata: infused
4436
+
4437
+ Example::
4438
+
4439
+ stack = Stack()
4440
+ my_vpc = VpcV2(self, "Vpc")
4441
+ vpn_gateway = my_vpc.enable_vpn_gateway_v2(
4442
+ vpn_route_propagation=[ec2.SubnetSelection(subnet_type=SubnetType.PUBLIC)],
4443
+ type=VpnConnectionType.IPSEC_1
4444
+ )
4445
+
4446
+ route_table = RouteTable(stack, "routeTable",
4447
+ vpc=my_vpc
4448
+ )
4449
+
4450
+ Route(stack, "route",
4451
+ destination="172.31.0.0/24",
4452
+ target={"gateway": vpn_gateway},
4453
+ route_table=route_table
4454
+ )
4455
+ '''
4456
+ if __debug__:
4457
+ type_hints = typing.get_type_hints(_typecheckingstub__e29191c56c11acb8fa2ca10b1e81f7c86e1e7ca21a360a0f41a7a6ec64c967c8)
4458
+ check_type(argname="argument type", value=type, expected_type=type_hints["type"])
4459
+ check_type(argname="argument amazon_side_asn", value=amazon_side_asn, expected_type=type_hints["amazon_side_asn"])
4460
+ check_type(argname="argument vpn_gateway_name", value=vpn_gateway_name, expected_type=type_hints["vpn_gateway_name"])
4461
+ check_type(argname="argument vpn_route_propagation", value=vpn_route_propagation, expected_type=type_hints["vpn_route_propagation"])
4462
+ self._values: typing.Dict[builtins.str, typing.Any] = {
4463
+ "type": type,
4464
+ }
4465
+ if amazon_side_asn is not None:
4466
+ self._values["amazon_side_asn"] = amazon_side_asn
4467
+ if vpn_gateway_name is not None:
4468
+ self._values["vpn_gateway_name"] = vpn_gateway_name
4469
+ if vpn_route_propagation is not None:
4470
+ self._values["vpn_route_propagation"] = vpn_route_propagation
4471
+
4472
+ @builtins.property
4473
+ def type(self) -> _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType:
4474
+ '''(experimental) The type of VPN connection the virtual private gateway supports.
3555
4475
 
4476
+ :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpngateway.html#cfn-ec2-vpngateway-type
3556
4477
  :stability: experimental
3557
4478
  '''
3558
- return typing.cast(_aws_cdk_aws_ec2_ceddda9d.CfnVPNGateway, jsii.get(self, "resource"))
4479
+ result = self._values.get("type")
4480
+ assert result is not None, "Required property 'type' is missing"
4481
+ return typing.cast(_aws_cdk_aws_ec2_ceddda9d.VpnConnectionType, result)
3559
4482
 
3560
4483
  @builtins.property
3561
- @jsii.member(jsii_name="routerTargetId")
3562
- def router_target_id(self) -> builtins.str:
3563
- '''(experimental) The ID of the route target.
4484
+ def amazon_side_asn(self) -> typing.Optional[jsii.Number]:
4485
+ '''(experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session.
4486
+
4487
+ :default: - no ASN set for BGP session
3564
4488
 
3565
4489
  :stability: experimental
3566
4490
  '''
3567
- return typing.cast(builtins.str, jsii.get(self, "routerTargetId"))
4491
+ result = self._values.get("amazon_side_asn")
4492
+ return typing.cast(typing.Optional[jsii.Number], result)
3568
4493
 
3569
4494
  @builtins.property
3570
- @jsii.member(jsii_name="routerType")
3571
- def router_type(self) -> _aws_cdk_aws_ec2_ceddda9d.RouterType:
3572
- '''(experimental) The type of router used in the route.
4495
+ def vpn_gateway_name(self) -> typing.Optional[builtins.str]:
4496
+ '''(experimental) The resource name of the VPN gateway.
4497
+
4498
+ :default: - resource provisioned without any name
3573
4499
 
3574
4500
  :stability: experimental
3575
4501
  '''
3576
- return typing.cast(_aws_cdk_aws_ec2_ceddda9d.RouterType, jsii.get(self, "routerType"))
4502
+ result = self._values.get("vpn_gateway_name")
4503
+ return typing.cast(typing.Optional[builtins.str], result)
3577
4504
 
3578
4505
  @builtins.property
3579
- @jsii.member(jsii_name="vpcId")
3580
- def vpc_id(self) -> builtins.str:
3581
- '''(experimental) The ID of the VPC for which to create the VPN gateway.
4506
+ def vpn_route_propagation(
4507
+ self,
4508
+ ) -> typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]]:
4509
+ '''(experimental) Subnets where the route propagation should be added.
4510
+
4511
+ :default: - no propogation for routes
3582
4512
 
3583
4513
  :stability: experimental
3584
4514
  '''
3585
- return typing.cast(builtins.str, jsii.get(self, "vpcId"))
4515
+ result = self._values.get("vpn_route_propagation")
4516
+ return typing.cast(typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]], result)
4517
+
4518
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
4519
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
4520
+
4521
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
4522
+ return not (rhs == self)
4523
+
4524
+ def __repr__(self) -> str:
4525
+ return "VPNGatewayV2Options(%s)" % ", ".join(
4526
+ k + "=" + repr(v) for k, v in self._values.items()
4527
+ )
3586
4528
 
3587
4529
 
3588
4530
  @jsii.data_type(
3589
- jsii_type="@aws-cdk/aws-ec2-alpha.VPNGatewayProps",
3590
- jsii_struct_bases=[],
4531
+ jsii_type="@aws-cdk/aws-ec2-alpha.VPNGatewayV2Props",
4532
+ jsii_struct_bases=[VPNGatewayV2Options],
3591
4533
  name_mapping={
3592
4534
  "type": "type",
3593
- "vpc": "vpc",
3594
4535
  "amazon_side_asn": "amazonSideAsn",
3595
4536
  "vpn_gateway_name": "vpnGatewayName",
4537
+ "vpn_route_propagation": "vpnRoutePropagation",
4538
+ "vpc": "vpc",
3596
4539
  },
3597
4540
  )
3598
- class VPNGatewayProps:
4541
+ class VPNGatewayV2Props(VPNGatewayV2Options):
3599
4542
  def __init__(
3600
4543
  self,
3601
4544
  *,
3602
4545
  type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
3603
- vpc: IVpcV2,
3604
4546
  amazon_side_asn: typing.Optional[jsii.Number] = None,
3605
4547
  vpn_gateway_name: typing.Optional[builtins.str] = None,
4548
+ vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
4549
+ vpc: IVpcV2,
3606
4550
  ) -> None:
3607
4551
  '''(experimental) Properties to define a VPN gateway.
3608
4552
 
3609
4553
  :param type: (experimental) The type of VPN connection the virtual private gateway supports.
4554
+ :param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
4555
+ :param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
4556
+ :param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
3610
4557
  :param vpc: (experimental) The ID of the VPC for which to create the VPN gateway.
3611
- :param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: none
3612
- :param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: none
3613
4558
 
3614
4559
  :stability: experimental
3615
4560
  :exampleMetadata: fixture=_generated
@@ -3621,23 +4566,34 @@ class VPNGatewayProps:
3621
4566
  import aws_cdk.aws_ec2_alpha as ec2_alpha
3622
4567
  from aws_cdk import aws_ec2 as ec2
3623
4568
 
4569
+ # subnet: ec2.Subnet
4570
+ # subnet_filter: ec2.SubnetFilter
3624
4571
  # vpc_v2: ec2_alpha.VpcV2
3625
4572
 
3626
- v_pNGateway_props = ec2_alpha.VPNGatewayProps(
4573
+ v_pNGateway_v2_props = ec2_alpha.VPNGatewayV2Props(
3627
4574
  type=ec2.VpnConnectionType.IPSEC_1,
3628
4575
  vpc=vpc_v2,
3629
4576
 
3630
4577
  # the properties below are optional
3631
4578
  amazon_side_asn=123,
3632
- vpn_gateway_name="vpnGatewayName"
4579
+ vpn_gateway_name="vpnGatewayName",
4580
+ vpn_route_propagation=[ec2.SubnetSelection(
4581
+ availability_zones=["availabilityZones"],
4582
+ one_per_az=False,
4583
+ subnet_filters=[subnet_filter],
4584
+ subnet_group_name="subnetGroupName",
4585
+ subnets=[subnet],
4586
+ subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
4587
+ )]
3633
4588
  )
3634
4589
  '''
3635
4590
  if __debug__:
3636
- type_hints = typing.get_type_hints(_typecheckingstub__1c064120251b11ed07bf6eabe8a01edd24bed2a26cc286de8870e231ea63a31b)
4591
+ type_hints = typing.get_type_hints(_typecheckingstub__3072d5168319d0db90903c5cbf3cd4040802f772c2763e1837c1fa6c7270ace9)
3637
4592
  check_type(argname="argument type", value=type, expected_type=type_hints["type"])
3638
- check_type(argname="argument vpc", value=vpc, expected_type=type_hints["vpc"])
3639
4593
  check_type(argname="argument amazon_side_asn", value=amazon_side_asn, expected_type=type_hints["amazon_side_asn"])
3640
4594
  check_type(argname="argument vpn_gateway_name", value=vpn_gateway_name, expected_type=type_hints["vpn_gateway_name"])
4595
+ check_type(argname="argument vpn_route_propagation", value=vpn_route_propagation, expected_type=type_hints["vpn_route_propagation"])
4596
+ check_type(argname="argument vpc", value=vpc, expected_type=type_hints["vpc"])
3641
4597
  self._values: typing.Dict[builtins.str, typing.Any] = {
3642
4598
  "type": type,
3643
4599
  "vpc": vpc,
@@ -3646,6 +4602,8 @@ class VPNGatewayProps:
3646
4602
  self._values["amazon_side_asn"] = amazon_side_asn
3647
4603
  if vpn_gateway_name is not None:
3648
4604
  self._values["vpn_gateway_name"] = vpn_gateway_name
4605
+ if vpn_route_propagation is not None:
4606
+ self._values["vpn_route_propagation"] = vpn_route_propagation
3649
4607
 
3650
4608
  @builtins.property
3651
4609
  def type(self) -> _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType:
@@ -3658,21 +4616,11 @@ class VPNGatewayProps:
3658
4616
  assert result is not None, "Required property 'type' is missing"
3659
4617
  return typing.cast(_aws_cdk_aws_ec2_ceddda9d.VpnConnectionType, result)
3660
4618
 
3661
- @builtins.property
3662
- def vpc(self) -> IVpcV2:
3663
- '''(experimental) The ID of the VPC for which to create the VPN gateway.
3664
-
3665
- :stability: experimental
3666
- '''
3667
- result = self._values.get("vpc")
3668
- assert result is not None, "Required property 'vpc' is missing"
3669
- return typing.cast(IVpcV2, result)
3670
-
3671
4619
  @builtins.property
3672
4620
  def amazon_side_asn(self) -> typing.Optional[jsii.Number]:
3673
4621
  '''(experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session.
3674
4622
 
3675
- :default: none
4623
+ :default: - no ASN set for BGP session
3676
4624
 
3677
4625
  :stability: experimental
3678
4626
  '''
@@ -3683,13 +4631,36 @@ class VPNGatewayProps:
3683
4631
  def vpn_gateway_name(self) -> typing.Optional[builtins.str]:
3684
4632
  '''(experimental) The resource name of the VPN gateway.
3685
4633
 
3686
- :default: none
4634
+ :default: - resource provisioned without any name
3687
4635
 
3688
4636
  :stability: experimental
3689
4637
  '''
3690
4638
  result = self._values.get("vpn_gateway_name")
3691
4639
  return typing.cast(typing.Optional[builtins.str], result)
3692
4640
 
4641
+ @builtins.property
4642
+ def vpn_route_propagation(
4643
+ self,
4644
+ ) -> typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]]:
4645
+ '''(experimental) Subnets where the route propagation should be added.
4646
+
4647
+ :default: - no propogation for routes
4648
+
4649
+ :stability: experimental
4650
+ '''
4651
+ result = self._values.get("vpn_route_propagation")
4652
+ return typing.cast(typing.Optional[typing.List[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection]], result)
4653
+
4654
+ @builtins.property
4655
+ def vpc(self) -> IVpcV2:
4656
+ '''(experimental) The ID of the VPC for which to create the VPN gateway.
4657
+
4658
+ :stability: experimental
4659
+ '''
4660
+ result = self._values.get("vpc")
4661
+ assert result is not None, "Required property 'vpc' is missing"
4662
+ return typing.cast(IVpcV2, result)
4663
+
3693
4664
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
3694
4665
  return isinstance(rhs, self.__class__) and rhs._values == self._values
3695
4666
 
@@ -3697,7 +4668,7 @@ class VPNGatewayProps:
3697
4668
  return not (rhs == self)
3698
4669
 
3699
4670
  def __repr__(self) -> str:
3700
- return "VPNGatewayProps(%s)" % ", ".join(
4671
+ return "VPNGatewayV2Props(%s)" % ", ".join(
3701
4672
  k + "=" + repr(v) for k, v in self._values.items()
3702
4673
  )
3703
4674
 
@@ -3712,7 +4683,6 @@ class VPNGatewayProps:
3712
4683
  "ipv4_cidr_block": "ipv4CidrBlock",
3713
4684
  "ipv4_ipam_pool": "ipv4IpamPool",
3714
4685
  "ipv4_netmask_length": "ipv4NetmaskLength",
3715
- "ipv6_cidr_block": "ipv6CidrBlock",
3716
4686
  "ipv6_ipam_pool": "ipv6IpamPool",
3717
4687
  "ipv6_netmask_length": "ipv6NetmaskLength",
3718
4688
  },
@@ -3727,19 +4697,17 @@ class VpcCidrOptions:
3727
4697
  ipv4_cidr_block: typing.Optional[builtins.str] = None,
3728
4698
  ipv4_ipam_pool: typing.Optional[IIpamPool] = None,
3729
4699
  ipv4_netmask_length: typing.Optional[jsii.Number] = None,
3730
- ipv6_cidr_block: typing.Optional[builtins.str] = None,
3731
4700
  ipv6_ipam_pool: typing.Optional[IIpamPool] = None,
3732
4701
  ipv6_netmask_length: typing.Optional[jsii.Number] = None,
3733
4702
  ) -> None:
3734
4703
  '''(experimental) Consolidated return parameters to pass to VPC construct.
3735
4704
 
3736
4705
  :param amazon_provided: (experimental) Use amazon provided IP range. Default: false
3737
- :param cidr_block_name: (experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource. Default: : no name for primary addresses
4706
+ :param cidr_block_name: (experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource. Default: - no name for primary addresses
3738
4707
  :param dependencies: (experimental) Dependency to associate Ipv6 CIDR block. Default: - No dependency
3739
- :param ipv4_cidr_block: (experimental) IPv4 CIDR Block. Default: - '10.0.0.0/16'
4708
+ :param ipv4_cidr_block: (experimental) IPv4 CIDR Block. Default: '10.0.0.0/16'
3740
4709
  :param ipv4_ipam_pool: (experimental) Ipv4 IPAM Pool. Default: - Only required when using IPAM Ipv4
3741
4710
  :param ipv4_netmask_length: (experimental) CIDR Mask for Vpc. Default: - Only required when using IPAM Ipv4
3742
- :param ipv6_cidr_block: (experimental) Implementing Ipv6. Default: - No ipv6 address
3743
4711
  :param ipv6_ipam_pool: (experimental) Ipv6 IPAM pool id for VPC range, can only be defined under public scope. Default: - no pool id
3744
4712
  :param ipv6_netmask_length: (experimental) CIDR Mask for Vpc. Default: - Only required when using AWS Ipam
3745
4713
 
@@ -3763,7 +4731,6 @@ class VpcCidrOptions:
3763
4731
  ipv4_cidr_block="ipv4CidrBlock",
3764
4732
  ipv4_ipam_pool=ipam_pool,
3765
4733
  ipv4_netmask_length=123,
3766
- ipv6_cidr_block="ipv6CidrBlock",
3767
4734
  ipv6_ipam_pool=ipam_pool,
3768
4735
  ipv6_netmask_length=123
3769
4736
  )
@@ -3776,7 +4743,6 @@ class VpcCidrOptions:
3776
4743
  check_type(argname="argument ipv4_cidr_block", value=ipv4_cidr_block, expected_type=type_hints["ipv4_cidr_block"])
3777
4744
  check_type(argname="argument ipv4_ipam_pool", value=ipv4_ipam_pool, expected_type=type_hints["ipv4_ipam_pool"])
3778
4745
  check_type(argname="argument ipv4_netmask_length", value=ipv4_netmask_length, expected_type=type_hints["ipv4_netmask_length"])
3779
- check_type(argname="argument ipv6_cidr_block", value=ipv6_cidr_block, expected_type=type_hints["ipv6_cidr_block"])
3780
4746
  check_type(argname="argument ipv6_ipam_pool", value=ipv6_ipam_pool, expected_type=type_hints["ipv6_ipam_pool"])
3781
4747
  check_type(argname="argument ipv6_netmask_length", value=ipv6_netmask_length, expected_type=type_hints["ipv6_netmask_length"])
3782
4748
  self._values: typing.Dict[builtins.str, typing.Any] = {}
@@ -3792,8 +4758,6 @@ class VpcCidrOptions:
3792
4758
  self._values["ipv4_ipam_pool"] = ipv4_ipam_pool
3793
4759
  if ipv4_netmask_length is not None:
3794
4760
  self._values["ipv4_netmask_length"] = ipv4_netmask_length
3795
- if ipv6_cidr_block is not None:
3796
- self._values["ipv6_cidr_block"] = ipv6_cidr_block
3797
4761
  if ipv6_ipam_pool is not None:
3798
4762
  self._values["ipv6_ipam_pool"] = ipv6_ipam_pool
3799
4763
  if ipv6_netmask_length is not None:
@@ -3814,7 +4778,7 @@ class VpcCidrOptions:
3814
4778
  def cidr_block_name(self) -> typing.Optional[builtins.str]:
3815
4779
  '''(experimental) Required to set Secondary cidr block resource name in order to generate unique logical id for the resource.
3816
4780
 
3817
- :default: : no name for primary addresses
4781
+ :default: - no name for primary addresses
3818
4782
 
3819
4783
  :stability: experimental
3820
4784
  '''
@@ -3838,7 +4802,7 @@ class VpcCidrOptions:
3838
4802
  def ipv4_cidr_block(self) -> typing.Optional[builtins.str]:
3839
4803
  '''(experimental) IPv4 CIDR Block.
3840
4804
 
3841
- :default: - '10.0.0.0/16'
4805
+ :default: '10.0.0.0/16'
3842
4806
 
3843
4807
  :stability: experimental
3844
4808
  '''
@@ -3867,17 +4831,6 @@ class VpcCidrOptions:
3867
4831
  result = self._values.get("ipv4_netmask_length")
3868
4832
  return typing.cast(typing.Optional[jsii.Number], result)
3869
4833
 
3870
- @builtins.property
3871
- def ipv6_cidr_block(self) -> typing.Optional[builtins.str]:
3872
- '''(experimental) Implementing Ipv6.
3873
-
3874
- :default: - No ipv6 address
3875
-
3876
- :stability: experimental
3877
- '''
3878
- result = self._values.get("ipv6_cidr_block")
3879
- return typing.cast(typing.Optional[builtins.str], result)
3880
-
3881
4834
  @builtins.property
3882
4835
  def ipv6_ipam_pool(self) -> typing.Optional[IIpamPool]:
3883
4836
  '''(experimental) Ipv6 IPAM pool id for VPC range, can only be defined under public scope.
@@ -4033,6 +4986,28 @@ class VpcV2Base(
4033
4986
 
4034
4987
  return typing.cast(_aws_cdk_aws_ec2_ceddda9d.ClientVpnEndpoint, jsii.invoke(self, "addClientVpnEndpoint", [id, options]))
4035
4988
 
4989
+ @jsii.member(jsii_name="addEgressOnlyInternetGateway")
4990
+ def add_egress_only_internet_gateway(
4991
+ self,
4992
+ *,
4993
+ destination: typing.Optional[builtins.str] = None,
4994
+ subnets: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
4995
+ ) -> None:
4996
+ '''(experimental) Adds a new Egress Only Internet Gateway to this VPC and defines a new route to the route table of given subnets.
4997
+
4998
+ :param destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
4999
+ :param subnets: (experimental) List of subnets where route to EGW will be added. Default: - no route created
5000
+
5001
+ :default: - in case of no input subnets, no route is created
5002
+
5003
+ :stability: experimental
5004
+ '''
5005
+ options = EgressOnlyInternetGatewayOptions(
5006
+ destination=destination, subnets=subnets
5007
+ )
5008
+
5009
+ return typing.cast(None, jsii.invoke(self, "addEgressOnlyInternetGateway", [options]))
5010
+
4036
5011
  @jsii.member(jsii_name="addFlowLog")
4037
5012
  def add_flow_log(
4038
5013
  self,
@@ -4128,6 +5103,70 @@ class VpcV2Base(
4128
5103
 
4129
5104
  return typing.cast(_aws_cdk_aws_ec2_ceddda9d.InterfaceVpcEndpoint, jsii.invoke(self, "addInterfaceEndpoint", [id, options]))
4130
5105
 
5106
+ @jsii.member(jsii_name="addInternetGateway")
5107
+ def add_internet_gateway(
5108
+ self,
5109
+ *,
5110
+ ipv4_destination: typing.Optional[builtins.str] = None,
5111
+ ipv6_destination: typing.Optional[builtins.str] = None,
5112
+ ) -> None:
5113
+ '''(experimental) Adds a new Internet Gateway to this VPC.
5114
+
5115
+ :param ipv4_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '0.0.0.0' all Ipv4 traffic
5116
+ :param ipv6_destination: (experimental) Destination Ipv6 address for EGW route. Default: - '::/0' all Ipv6 traffic
5117
+
5118
+ :default: - creates a new route for public subnets(with all outbound access) to the Internet Gateway.
5119
+
5120
+ :stability: experimental
5121
+ '''
5122
+ options = InternetGatewayOptions(
5123
+ ipv4_destination=ipv4_destination, ipv6_destination=ipv6_destination
5124
+ )
5125
+
5126
+ return typing.cast(None, jsii.invoke(self, "addInternetGateway", [options]))
5127
+
5128
+ @jsii.member(jsii_name="addNatGateway")
5129
+ def add_nat_gateway(
5130
+ self,
5131
+ *,
5132
+ subnet: ISubnetV2,
5133
+ allocation_id: typing.Optional[builtins.str] = None,
5134
+ connectivity_type: typing.Optional[NatConnectivityType] = None,
5135
+ max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
5136
+ nat_gateway_name: typing.Optional[builtins.str] = None,
5137
+ private_ip_address: typing.Optional[builtins.str] = None,
5138
+ secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
5139
+ secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
5140
+ secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
5141
+ ) -> NatGateway:
5142
+ '''(experimental) Adds a new NAT Gateway to the given subnet of this VPC of given subnets.
5143
+
5144
+ :param subnet: (experimental) The subnet in which the NAT gateway is located.
5145
+ :param allocation_id: (experimental) AllocationID of Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway. Default: - attr.allocationID of a new Elastic IP created by default //TODO: ADD L2 for elastic ip
5146
+ :param connectivity_type: (experimental) Indicates whether the NAT gateway supports public or private connectivity. Default: NatConnectivityType.Public
5147
+ :param max_drain_duration: (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. Default: 350seconds
5148
+ :param nat_gateway_name: (experimental) The resource name of the NAT gateway. Default: - NATGW provisioned without any name
5149
+ :param private_ip_address: (experimental) The private IPv4 address to assign to the NAT gateway. Default: - If you don't provide an address, a private IPv4 address will be automatically assigned.
5150
+ :param secondary_allocation_ids: (experimental) Secondary EIP allocation IDs. Default: - no secondary allocation IDs attached to NATGW
5151
+ :param secondary_private_ip_address_count: (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary allocation IDs associated with NATGW
5152
+ :param secondary_private_ip_addresses: (experimental) Secondary private IPv4 addresses. ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time. Default: - no secondary private IpAddresses associated with NATGW
5153
+
5154
+ :stability: experimental
5155
+ '''
5156
+ options = NatGatewayOptions(
5157
+ subnet=subnet,
5158
+ allocation_id=allocation_id,
5159
+ connectivity_type=connectivity_type,
5160
+ max_drain_duration=max_drain_duration,
5161
+ nat_gateway_name=nat_gateway_name,
5162
+ private_ip_address=private_ip_address,
5163
+ secondary_allocation_ids=secondary_allocation_ids,
5164
+ secondary_private_ip_address_count=secondary_private_ip_address_count,
5165
+ secondary_private_ip_addresses=secondary_private_ip_addresses,
5166
+ )
5167
+
5168
+ return typing.cast(NatGateway, jsii.invoke(self, "addNatGateway", [options]))
5169
+
4131
5170
  @jsii.member(jsii_name="addVpnConnection")
4132
5171
  def add_vpn_connection(
4133
5172
  self,
@@ -4165,13 +5204,15 @@ class VpcV2Base(
4165
5204
  type: builtins.str,
4166
5205
  amazon_side_asn: typing.Optional[jsii.Number] = None,
4167
5206
  ) -> None:
4168
- '''(experimental) Adds a VPN Gateway to this VPC.
5207
+ '''(deprecated) Adds a VPN Gateway to this VPC.
4169
5208
 
4170
5209
  :param vpn_route_propagation: Provide an array of subnets where the route propagation should be added. Default: noPropagation
4171
5210
  :param type: Default type ipsec.1.
4172
5211
  :param amazon_side_asn: Explicitly specify an Asn or let aws pick an Asn for you. Default: 65000
4173
5212
 
4174
- :stability: experimental
5213
+ :deprecated: use enableVpnGatewayV2 for compatibility with VPCV2.Route
5214
+
5215
+ :stability: deprecated
4175
5216
  '''
4176
5217
  options = _aws_cdk_aws_ec2_ceddda9d.EnableVpnGatewayOptions(
4177
5218
  vpn_route_propagation=vpn_route_propagation,
@@ -4181,6 +5222,33 @@ class VpcV2Base(
4181
5222
 
4182
5223
  return typing.cast(None, jsii.invoke(self, "enableVpnGateway", [options]))
4183
5224
 
5225
+ @jsii.member(jsii_name="enableVpnGatewayV2")
5226
+ def enable_vpn_gateway_v2(
5227
+ self,
5228
+ *,
5229
+ type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
5230
+ amazon_side_asn: typing.Optional[jsii.Number] = None,
5231
+ vpn_gateway_name: typing.Optional[builtins.str] = None,
5232
+ vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
5233
+ ) -> VPNGatewayV2:
5234
+ '''(experimental) Adds VPNGAtewayV2 to this VPC.
5235
+
5236
+ :param type: (experimental) The type of VPN connection the virtual private gateway supports.
5237
+ :param amazon_side_asn: (experimental) The private Autonomous System Number (ASN) for the Amazon side of a BGP session. Default: - no ASN set for BGP session
5238
+ :param vpn_gateway_name: (experimental) The resource name of the VPN gateway. Default: - resource provisioned without any name
5239
+ :param vpn_route_propagation: (experimental) Subnets where the route propagation should be added. Default: - no propogation for routes
5240
+
5241
+ :stability: experimental
5242
+ '''
5243
+ options = VPNGatewayV2Options(
5244
+ type=type,
5245
+ amazon_side_asn=amazon_side_asn,
5246
+ vpn_gateway_name=vpn_gateway_name,
5247
+ vpn_route_propagation=vpn_route_propagation,
5248
+ )
5249
+
5250
+ return typing.cast(VPNGatewayV2, jsii.invoke(self, "enableVpnGatewayV2", [options]))
5251
+
4184
5252
  @jsii.member(jsii_name="selectSubnetObjects")
4185
5253
  def _select_subnet_objects(
4186
5254
  self,
@@ -4353,6 +5421,15 @@ class VpcV2Base(
4353
5421
  '''
4354
5422
  ...
4355
5423
 
5424
+ @builtins.property
5425
+ @jsii.member(jsii_name="internetGatewayId")
5426
+ def internet_gateway_id(self) -> typing.Optional[builtins.str]:
5427
+ '''(experimental) Returns the id of the Internet Gateway (if enabled).
5428
+
5429
+ :stability: experimental
5430
+ '''
5431
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "internetGatewayId"))
5432
+
4356
5433
  @builtins.property
4357
5434
  @jsii.member(jsii_name="vpnGatewayId")
4358
5435
  def vpn_gateway_id(self) -> typing.Optional[builtins.str]:
@@ -4484,9 +5561,9 @@ class VpcV2Props:
4484
5561
  :param default_instance_tenancy: (experimental) The default tenancy of instances launched into the VPC. By setting this to dedicated tenancy, instances will be launched on hardware dedicated to a single AWS customer, unless specifically specified at instance launch time. Please note, not all instance types are usable with Dedicated tenancy. Default: DefaultInstanceTenancy.Default (shared) tenancy
4485
5562
  :param enable_dns_hostnames: (experimental) Indicates whether the instances launched in the VPC get DNS hostnames. Default: true
4486
5563
  :param enable_dns_support: (experimental) Indicates whether the DNS resolution is supported for the VPC. Default: true
4487
- :param primary_address_block: (experimental) A must IPv4 CIDR block for the VPC https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html. Default: - Ipv4 CIDR Block ('10.0.0.0/16')
4488
- :param secondary_address_blocks: (experimental) The secondary CIDR blocks associated with the VPC. Can be IPv4 or IPv6, two IPv4 ranges must follow RFC#1918 convention For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-resize}. Default: - No secondary IP address
4489
- :param vpc_name: (experimental) Physical name for the VPC. Default: : autogenerated by CDK
5564
+ :param primary_address_block: (experimental) A must IPv4 CIDR block for the VPC. Default: - Ipv4 CIDR Block ('10.0.0.0/16')
5565
+ :param secondary_address_blocks: (experimental) The secondary CIDR blocks associated with the VPC. Can be IPv4 or IPv6, two IPv4 ranges must follow RFC#1918 convention For more information, Default: - No secondary IP address
5566
+ :param vpc_name: (experimental) Physical name for the VPC. Default: - autogenerated by CDK
4490
5567
 
4491
5568
  :stability: experimental
4492
5569
  :exampleMetadata: infused
@@ -4494,19 +5571,22 @@ class VpcV2Props:
4494
5571
  Example::
4495
5572
 
4496
5573
  stack = Stack()
4497
- my_vpc = vpc_v2.VpcV2(self, "Vpc",
4498
- secondary_address_blocks=[
4499
- vpc_v2.IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIp")
4500
- ]
5574
+ my_vpc = VpcV2(self, "Vpc",
5575
+ primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
5576
+ secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
5577
+ cidr_block_name="AmazonProvided"
5578
+ )]
4501
5579
  )
4502
5580
 
4503
- vpc_v2.SubnetV2(self, "subnetA",
4504
- vpc=my_vpc,
4505
- availability_zone="us-east-1a",
4506
- ipv4_cidr_block=vpc_v2.IpCidr("10.0.0.0/24"),
4507
- ipv6_cidr_block=vpc_v2.IpCidr("2a05:d02c:25:4000::/60"),
4508
- subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
5581
+ eigw = EgressOnlyInternetGateway(self, "EIGW",
5582
+ vpc=my_vpc
4509
5583
  )
5584
+
5585
+ route_table = RouteTable(self, "RouteTable",
5586
+ vpc=my_vpc
5587
+ )
5588
+
5589
+ route_table.add_route("EIGW", "::/0", {"gateway": eigw})
4510
5590
  '''
4511
5591
  if __debug__:
4512
5592
  type_hints = typing.get_type_hints(_typecheckingstub__8f915ef5e4a9fa4854227228067c81d198633b3f6b9621c83cee1390bc703549)
@@ -4572,10 +5652,11 @@ class VpcV2Props:
4572
5652
 
4573
5653
  @builtins.property
4574
5654
  def primary_address_block(self) -> typing.Optional[IIpAddresses]:
4575
- '''(experimental) A must IPv4 CIDR block for the VPC https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html.
5655
+ '''(experimental) A must IPv4 CIDR block for the VPC.
4576
5656
 
4577
5657
  :default: - Ipv4 CIDR Block ('10.0.0.0/16')
4578
5658
 
5659
+ :see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html
4579
5660
  :stability: experimental
4580
5661
  '''
4581
5662
  result = self._values.get("primary_address_block")
@@ -4586,10 +5667,11 @@ class VpcV2Props:
4586
5667
  '''(experimental) The secondary CIDR blocks associated with the VPC.
4587
5668
 
4588
5669
  Can be IPv4 or IPv6, two IPv4 ranges must follow RFC#1918 convention
4589
- For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-resize}.
5670
+ For more information,
4590
5671
 
4591
5672
  :default: - No secondary IP address
4592
5673
 
5674
+ :see: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-resize}.
4593
5675
  :stability: experimental
4594
5676
  '''
4595
5677
  result = self._values.get("secondary_address_blocks")
@@ -4599,7 +5681,7 @@ class VpcV2Props:
4599
5681
  def vpc_name(self) -> typing.Optional[builtins.str]:
4600
5682
  '''(experimental) Physical name for the VPC.
4601
5683
 
4602
- :default: : autogenerated by CDK
5684
+ :default: - autogenerated by CDK
4603
5685
 
4604
5686
  :stability: experimental
4605
5687
  '''
@@ -4628,22 +5710,27 @@ class EgressOnlyInternetGateway(
4628
5710
 
4629
5711
  :stability: experimental
4630
5712
  :resource: AWS::EC2::EgressOnlyInternetGateway
4631
- :exampleMetadata: fixture=_generated
5713
+ :exampleMetadata: infused
4632
5714
 
4633
5715
  Example::
4634
5716
 
4635
- # The code below shows an example of how to instantiate this type.
4636
- # The values are placeholders you should change.
4637
- import aws_cdk.aws_ec2_alpha as ec2_alpha
4638
-
4639
- # vpc_v2: ec2_alpha.VpcV2
5717
+ stack = Stack()
5718
+ my_vpc = VpcV2(self, "Vpc",
5719
+ primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
5720
+ secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
5721
+ cidr_block_name="AmazonProvided"
5722
+ )]
5723
+ )
4640
5724
 
4641
- egress_only_internet_gateway = ec2_alpha.EgressOnlyInternetGateway(self, "MyEgressOnlyInternetGateway",
4642
- vpc=vpc_v2,
5725
+ eigw = EgressOnlyInternetGateway(self, "EIGW",
5726
+ vpc=my_vpc
5727
+ )
4643
5728
 
4644
- # the properties below are optional
4645
- egress_only_internet_gateway_name="egressOnlyInternetGatewayName"
5729
+ route_table = RouteTable(self, "RouteTable",
5730
+ vpc=my_vpc
4646
5731
  )
5732
+
5733
+ route_table.add_route("EIGW", "::/0", {"gateway": eigw})
4647
5734
  '''
4648
5735
 
4649
5736
  def __init__(
@@ -4658,7 +5745,7 @@ class EgressOnlyInternetGateway(
4658
5745
  :param scope: -
4659
5746
  :param id: -
4660
5747
  :param vpc: (experimental) The ID of the VPC for which to create the egress-only internet gateway.
4661
- :param egress_only_internet_gateway_name: (experimental) The resource name of the egress-only internet gateway. Default: none
5748
+ :param egress_only_internet_gateway_name: (experimental) The resource name of the egress-only internet gateway. Default: - provisioned without a resource name
4662
5749
 
4663
5750
  :stability: experimental
4664
5751
  '''
@@ -4716,26 +5803,22 @@ class VpcV2(
4716
5803
 
4717
5804
  Example::
4718
5805
 
4719
- my_vpc = vpc_v2.VpcV2(self, "Vpc")
4720
- route_table = vpc_v2.RouteTable(self, "RouteTable",
5806
+ stack = Stack()
5807
+ my_vpc = VpcV2(self, "Vpc")
5808
+ route_table = RouteTable(self, "RouteTable",
4721
5809
  vpc=my_vpc
4722
5810
  )
4723
- subnet = vpc_v2.SubnetV2(self, "Subnet",
5811
+ subnet = SubnetV2(self, "Subnet",
4724
5812
  vpc=my_vpc,
4725
5813
  availability_zone="eu-west-2a",
4726
5814
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
4727
- subnet_type=ec2.SubnetType.PRIVATE
5815
+ subnet_type=SubnetType.PUBLIC
4728
5816
  )
4729
5817
 
4730
- dynamo_endpoint = ec2.GatewayVpcEndpoint(self, "DynamoEndpoint",
4731
- service=ec2.GatewayVpcEndpointAwsService.DYNAMODB,
4732
- vpc=my_vpc,
4733
- subnets=[subnet]
4734
- )
4735
- vpc_v2.Route(self, "DynamoDBRoute",
4736
- route_table=route_table,
4737
- destination="0.0.0.0/0",
4738
- target={"endpoint": dynamo_endpoint}
5818
+ my_vpc.add_internet_gateway()
5819
+ my_vpc.add_nat_gateway(
5820
+ subnet=subnet,
5821
+ connectivity_type=NatConnectivityType.PUBLIC
4739
5822
  )
4740
5823
  '''
4741
5824
 
@@ -4757,9 +5840,9 @@ class VpcV2(
4757
5840
  :param default_instance_tenancy: (experimental) The default tenancy of instances launched into the VPC. By setting this to dedicated tenancy, instances will be launched on hardware dedicated to a single AWS customer, unless specifically specified at instance launch time. Please note, not all instance types are usable with Dedicated tenancy. Default: DefaultInstanceTenancy.Default (shared) tenancy
4758
5841
  :param enable_dns_hostnames: (experimental) Indicates whether the instances launched in the VPC get DNS hostnames. Default: true
4759
5842
  :param enable_dns_support: (experimental) Indicates whether the DNS resolution is supported for the VPC. Default: true
4760
- :param primary_address_block: (experimental) A must IPv4 CIDR block for the VPC https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html. Default: - Ipv4 CIDR Block ('10.0.0.0/16')
4761
- :param secondary_address_blocks: (experimental) The secondary CIDR blocks associated with the VPC. Can be IPv4 or IPv6, two IPv4 ranges must follow RFC#1918 convention For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-resize}. Default: - No secondary IP address
4762
- :param vpc_name: (experimental) Physical name for the VPC. Default: : autogenerated by CDK
5843
+ :param primary_address_block: (experimental) A must IPv4 CIDR block for the VPC. Default: - Ipv4 CIDR Block ('10.0.0.0/16')
5844
+ :param secondary_address_blocks: (experimental) The secondary CIDR blocks associated with the VPC. Can be IPv4 or IPv6, two IPv4 ranges must follow RFC#1918 convention For more information, Default: - No secondary IP address
5845
+ :param vpc_name: (experimental) Physical name for the VPC. Default: - autogenerated by CDK
4763
5846
 
4764
5847
  :stability: experimental
4765
5848
  '''
@@ -4888,7 +5971,7 @@ class VpcV2(
4888
5971
  @builtins.property
4889
5972
  @jsii.member(jsii_name="useIpv6")
4890
5973
  def use_ipv6(self) -> builtins.bool:
4891
- '''(experimental) For validation to define IPv6 subnets, set to true in case of Amazon Provided IPv6 cidr range IPv6 addresses can be attached to the subnets.
5974
+ '''(experimental) For validation to define IPv6 subnets, set to true in case of Amazon Provided IPv6 cidr range if true, IPv6 addresses can be attached to the subnets.
4892
5975
 
4893
5976
  :default: false
4894
5977
 
@@ -4930,6 +6013,7 @@ __all__ = [
4930
6013
  "AddressFamily",
4931
6014
  "AwsServiceName",
4932
6015
  "EgressOnlyInternetGateway",
6016
+ "EgressOnlyInternetGatewayOptions",
4933
6017
  "EgressOnlyInternetGatewayProps",
4934
6018
  "IIpAddresses",
4935
6019
  "IIpamPool",
@@ -4939,6 +6023,7 @@ __all__ = [
4939
6023
  "ISubnetV2",
4940
6024
  "IVpcV2",
4941
6025
  "InternetGateway",
6026
+ "InternetGatewayOptions",
4942
6027
  "InternetGatewayProps",
4943
6028
  "IpAddresses",
4944
6029
  "IpCidr",
@@ -4951,6 +6036,7 @@ __all__ = [
4951
6036
  "IpamScopeType",
4952
6037
  "NatConnectivityType",
4953
6038
  "NatGateway",
6039
+ "NatGatewayOptions",
4954
6040
  "NatGatewayProps",
4955
6041
  "PoolOptions",
4956
6042
  "Route",
@@ -4962,8 +6048,9 @@ __all__ = [
4962
6048
  "SecondaryAddressProps",
4963
6049
  "SubnetV2",
4964
6050
  "SubnetV2Props",
4965
- "VPNGateway",
4966
- "VPNGatewayProps",
6051
+ "VPNGatewayV2",
6052
+ "VPNGatewayV2Options",
6053
+ "VPNGatewayV2Props",
4967
6054
  "VpcCidrOptions",
4968
6055
  "VpcV2",
4969
6056
  "VpcV2Base",
@@ -4972,6 +6059,14 @@ __all__ = [
4972
6059
 
4973
6060
  publication.publish()
4974
6061
 
6062
+ def _typecheckingstub__47cf639398ded64820e35dac43908a70a34ddc76a3ed35cc0c24357b0e01f48d(
6063
+ *,
6064
+ destination: typing.Optional[builtins.str] = None,
6065
+ subnets: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
6066
+ ) -> None:
6067
+ """Type checking stubs"""
6068
+ pass
6069
+
4975
6070
  def _typecheckingstub__a1cb0281052a85d3461453c956e87b81e82be05002c1ac33451b382cfcf0ea7e(
4976
6071
  *,
4977
6072
  vpc: IVpcV2,
@@ -5011,6 +6106,14 @@ def _typecheckingstub__a1ed9b26ff938b529db1af6f12978e1aa57b9cdaf5a5c589675cf7b8f
5011
6106
  """Type checking stubs"""
5012
6107
  pass
5013
6108
 
6109
+ def _typecheckingstub__1767be14586e30c26bcd910b9753aae1720568db2bf09fbf8dd100e10ab1fc09(
6110
+ *,
6111
+ ipv4_destination: typing.Optional[builtins.str] = None,
6112
+ ipv6_destination: typing.Optional[builtins.str] = None,
6113
+ ) -> None:
6114
+ """Type checking stubs"""
6115
+ pass
6116
+
5014
6117
  def _typecheckingstub__b4699002455f77fce358247d059e2af25aa232257e94012a7ff9adcc0f4d4268(
5015
6118
  *,
5016
6119
  vpc: IVpcV2,
@@ -5088,7 +6191,23 @@ def _typecheckingstub__3204c5cc1ee92d73075b1e2c597a7d7bb9eb73b154f33262369b6b4ac
5088
6191
  scope: _constructs_77d1e7e8.Construct,
5089
6192
  id: builtins.str,
5090
6193
  *,
5091
- subnet: _aws_cdk_aws_ec2_ceddda9d.ISubnet,
6194
+ vpc: typing.Optional[IVpcV2] = None,
6195
+ subnet: ISubnetV2,
6196
+ allocation_id: typing.Optional[builtins.str] = None,
6197
+ connectivity_type: typing.Optional[NatConnectivityType] = None,
6198
+ max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
6199
+ nat_gateway_name: typing.Optional[builtins.str] = None,
6200
+ private_ip_address: typing.Optional[builtins.str] = None,
6201
+ secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
6202
+ secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
6203
+ secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
6204
+ ) -> None:
6205
+ """Type checking stubs"""
6206
+ pass
6207
+
6208
+ def _typecheckingstub__b95898dda7ef46705953a45c7eea2438b79c93d898a7eb07a91955ee9ff221c7(
6209
+ *,
6210
+ subnet: ISubnetV2,
5092
6211
  allocation_id: typing.Optional[builtins.str] = None,
5093
6212
  connectivity_type: typing.Optional[NatConnectivityType] = None,
5094
6213
  max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
@@ -5097,14 +6216,13 @@ def _typecheckingstub__3204c5cc1ee92d73075b1e2c597a7d7bb9eb73b154f33262369b6b4ac
5097
6216
  secondary_allocation_ids: typing.Optional[typing.Sequence[builtins.str]] = None,
5098
6217
  secondary_private_ip_address_count: typing.Optional[jsii.Number] = None,
5099
6218
  secondary_private_ip_addresses: typing.Optional[typing.Sequence[builtins.str]] = None,
5100
- vpc: typing.Optional[IVpcV2] = None,
5101
6219
  ) -> None:
5102
6220
  """Type checking stubs"""
5103
6221
  pass
5104
6222
 
5105
6223
  def _typecheckingstub__50c6c285bd9604aa1bbf23945426abd3cb4259870f0a85edd40b87eb08b29903(
5106
6224
  *,
5107
- subnet: _aws_cdk_aws_ec2_ceddda9d.ISubnet,
6225
+ subnet: ISubnetV2,
5108
6226
  allocation_id: typing.Optional[builtins.str] = None,
5109
6227
  connectivity_type: typing.Optional[NatConnectivityType] = None,
5110
6228
  max_drain_duration: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
@@ -5161,6 +6279,14 @@ def _typecheckingstub__cfa486baea72e1e0413e458ea1f52d60725dbcdfeed33f2e810006af4
5161
6279
  """Type checking stubs"""
5162
6280
  pass
5163
6281
 
6282
+ def _typecheckingstub__920d6a12797cd2ad571157da68e37100c7d72b72ff09fd42451a65b73f154dd0(
6283
+ id: builtins.str,
6284
+ destination: builtins.str,
6285
+ target: RouteTargetType,
6286
+ ) -> None:
6287
+ """Type checking stubs"""
6288
+ pass
6289
+
5164
6290
  def _typecheckingstub__271dc5ccfa2e958efecaeb52a22e0ecbf03734c62d76ebbf18cb73e88deea29f(
5165
6291
  *,
5166
6292
  vpc: IVpcV2,
@@ -5221,24 +6347,36 @@ def _typecheckingstub__95ce99f8025433ac8b79825abef6ff91da4dfd0693fd24dadedcee63e
5221
6347
  """Type checking stubs"""
5222
6348
  pass
5223
6349
 
5224
- def _typecheckingstub__f6669efe999b4d7fb070da87ce4f6945c7b3b900d1c035c2e7a3dbb26415c28f(
6350
+ def _typecheckingstub__99ebb03388deee94929850a6302ea70455c70b08fdbc048c0ad431df4f5d7bff(
5225
6351
  scope: _constructs_77d1e7e8.Construct,
5226
6352
  id: builtins.str,
5227
6353
  *,
5228
- type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
5229
6354
  vpc: IVpcV2,
6355
+ type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
5230
6356
  amazon_side_asn: typing.Optional[jsii.Number] = None,
5231
6357
  vpn_gateway_name: typing.Optional[builtins.str] = None,
6358
+ vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
5232
6359
  ) -> None:
5233
6360
  """Type checking stubs"""
5234
6361
  pass
5235
6362
 
5236
- def _typecheckingstub__1c064120251b11ed07bf6eabe8a01edd24bed2a26cc286de8870e231ea63a31b(
6363
+ def _typecheckingstub__e29191c56c11acb8fa2ca10b1e81f7c86e1e7ca21a360a0f41a7a6ec64c967c8(
6364
+ *,
6365
+ type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
6366
+ amazon_side_asn: typing.Optional[jsii.Number] = None,
6367
+ vpn_gateway_name: typing.Optional[builtins.str] = None,
6368
+ vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
6369
+ ) -> None:
6370
+ """Type checking stubs"""
6371
+ pass
6372
+
6373
+ def _typecheckingstub__3072d5168319d0db90903c5cbf3cd4040802f772c2763e1837c1fa6c7270ace9(
5237
6374
  *,
5238
6375
  type: _aws_cdk_aws_ec2_ceddda9d.VpnConnectionType,
5239
- vpc: IVpcV2,
5240
6376
  amazon_side_asn: typing.Optional[jsii.Number] = None,
5241
6377
  vpn_gateway_name: typing.Optional[builtins.str] = None,
6378
+ vpn_route_propagation: typing.Optional[typing.Sequence[typing.Union[_aws_cdk_aws_ec2_ceddda9d.SubnetSelection, typing.Dict[builtins.str, typing.Any]]]] = None,
6379
+ vpc: IVpcV2,
5242
6380
  ) -> None:
5243
6381
  """Type checking stubs"""
5244
6382
  pass
@@ -5251,7 +6389,6 @@ def _typecheckingstub__dc5a774224468f268ba34d837f3aec361583306c8694ae77cdb19bb4c
5251
6389
  ipv4_cidr_block: typing.Optional[builtins.str] = None,
5252
6390
  ipv4_ipam_pool: typing.Optional[IIpamPool] = None,
5253
6391
  ipv4_netmask_length: typing.Optional[jsii.Number] = None,
5254
- ipv6_cidr_block: typing.Optional[builtins.str] = None,
5255
6392
  ipv6_ipam_pool: typing.Optional[IIpamPool] = None,
5256
6393
  ipv6_netmask_length: typing.Optional[jsii.Number] = None,
5257
6394
  ) -> None: