aws-cdk.aws-ec2-alpha 2.164.1a0__py3-none-any.whl → 2.166.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.

@@ -35,8 +35,6 @@ VpcV2(self, "Vpc",
35
35
 
36
36
  `VpcV2` does not automatically create subnets or allocate IP addresses, which is different from the `Vpc` construct.
37
37
 
38
- Importing existing VPC in an account into CDK as a `VpcV2` is not yet supported.
39
-
40
38
  ## SubnetV2
41
39
 
42
40
  `SubnetV2` is a re-write of the [`ec2.Subnet`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Subnet.html) construct.
@@ -59,8 +57,6 @@ SubnetV2(self, "subnetA",
59
57
  )
60
58
  ```
61
59
 
62
- Same as `VpcV2`, importing existing subnets is not yet supported.
63
-
64
60
  ## IP Addresses Management
65
61
 
66
62
  By default `VpcV2` uses `10.0.0.0/16` as the primary CIDR if none is defined.
@@ -359,6 +355,127 @@ my_vpc.add_internet_gateway(
359
355
  ipv4_destination="192.168.0.0/16"
360
356
  )
361
357
  ```
358
+
359
+ ## Importing an existing VPC
360
+
361
+ You can import an existing VPC and its subnets using the `VpcV2.fromVpcV2Attributes()` method or an individual subnet using `SubnetV2.fromSubnetV2Attributes()` method.
362
+
363
+ ### Importing a VPC
364
+
365
+ To import an existing VPC, use the `VpcV2.fromVpcV2Attributes()` method. You'll need to provide the VPC ID, primary CIDR block, and information about the subnets. You can import secondary address as well created through IPAM, BYOIP(IPv4) or enabled through Amazon Provided IPv6. You must provide VPC Id and its primary CIDR block for importing it.
366
+
367
+ If you wish to add a new subnet to imported VPC, new subnet's IP range(IPv4) will be validated against provided secondary and primary address block to confirm that it is within the the range of VPC.
368
+
369
+ Here's an example of importing a VPC with only the required parameters
370
+
371
+ ```python
372
+ stack = Stack()
373
+
374
+ imported_vpc = VpcV2.from_vpc_v2_attributes(stack, "ImportedVpc",
375
+ vpc_id="mockVpcID",
376
+ vpc_cidr_block="10.0.0.0/16"
377
+ )
378
+ ```
379
+
380
+ In case of cross account or cross region VPC, its recommended to provide region and ownerAccountId so that these values for the VPC can be used to populate correct arn value for the VPC. If a VPC region and account ID is not provided, then region and account configured in the stack will be used. Furthermore, these fields will be referenced later while setting up VPC peering connection, so its necessary to set these fields to a correct value.
381
+
382
+ Below is an example of importing a cross region and cross acount VPC, VPC arn for this case would be 'arn:aws:ec2:us-west-2:123456789012:vpc/mockVpcID'
383
+
384
+ ```python
385
+ stack = Stack()
386
+
387
+ # Importing a cross acount or cross region VPC
388
+ imported_vpc = VpcV2.from_vpc_v2_attributes(stack, "ImportedVpc",
389
+ vpc_id="mockVpcID",
390
+ vpc_cidr_block="10.0.0.0/16",
391
+ owner_account_id="123456789012",
392
+ region="us-west-2"
393
+ )
394
+ ```
395
+
396
+ Here's an example of how to import a VPC with multiple CIDR blocks, IPv6 support, and different subnet types:
397
+
398
+ In this example, we're importing a VPC with:
399
+
400
+ * A primary CIDR block (10.1.0.0/16)
401
+ * One secondary IPv4 CIDR block (10.2.0.0/16)
402
+ * Two secondary address using IPAM pool (IPv4 and IPv6)
403
+ * VPC has Amazon-provided IPv6 CIDR enabled
404
+ * An isolated subnet in us-west-2a
405
+ * A public subnet in us-west-2b
406
+
407
+ ```python
408
+ stack = Stack()
409
+
410
+ imported_vpc = VpcV2.from_vpc_v2_attributes(self, "ImportedVPC",
411
+ vpc_id="vpc-XXX",
412
+ vpc_cidr_block="10.1.0.0/16",
413
+ secondary_cidr_blocks=[VPCCidrBlockattributes(
414
+ cidr_block="10.2.0.0/16",
415
+ cidr_block_name="ImportedBlock1"
416
+ ), VPCCidrBlockattributes(
417
+ ipv6_ipam_pool_id="ipam-pool-XXX",
418
+ ipv6_netmask_length=52,
419
+ cidr_block_name="ImportedIpamIpv6"
420
+ ), VPCCidrBlockattributes(
421
+ ipv4_ipam_pool_id="ipam-pool-XXX",
422
+ ipv4_ipam_provisioned_cidrs=["10.2.0.0/16"],
423
+ cidr_block_name="ImportedIpamIpv4"
424
+ ), VPCCidrBlockattributes(
425
+ amazon_provided_ipv6_cidr_block=True
426
+ )
427
+ ],
428
+ subnets=[SubnetV2Attributes(
429
+ subnet_name="IsolatedSubnet2",
430
+ subnet_id="subnet-03cd773c0fe08ed26",
431
+ subnet_type=SubnetType.PRIVATE_ISOLATED,
432
+ availability_zone="us-west-2a",
433
+ ipv4_cidr_block="10.2.0.0/24",
434
+ route_table_id="rtb-0871c310f98da2cbb"
435
+ ), SubnetV2Attributes(
436
+ subnet_id="subnet-0fa477e01db27d820",
437
+ subnet_type=SubnetType.PUBLIC,
438
+ availability_zone="us-west-2b",
439
+ ipv4_cidr_block="10.3.0.0/24",
440
+ route_table_id="rtb-014f3043098fe4b96"
441
+ )]
442
+ )
443
+
444
+ # You can now use the imported VPC in your stack
445
+
446
+ # Adding a new subnet to the imported VPC
447
+ imported_subnet = SubnetV2(self, "NewSubnet",
448
+ availability_zone="us-west-2a",
449
+ ipv4_cidr_block=IpCidr("10.2.2.0/24"),
450
+ vpc=imported_vpc,
451
+ subnet_type=SubnetType.PUBLIC
452
+ )
453
+
454
+ # Adding gateways to the imported VPC
455
+ imported_vpc.add_internet_gateway()
456
+ imported_vpc.add_nat_gateway(subnet=imported_subnet)
457
+ imported_vpc.add_egress_only_internet_gateway()
458
+ ```
459
+
460
+ You can add more subnets as needed by including additional entries in the `isolatedSubnets`, `publicSubnets`, or other subnet type arrays (e.g., `privateSubnets`).
461
+
462
+ ### Importing Subnets
463
+
464
+ You can also import individual subnets using the `SubnetV2.fromSubnetV2Attributes()` method. This is useful when you need to work with specific subnets independently of a VPC.
465
+
466
+ Here's an example of how to import a subnet:
467
+
468
+ ```python
469
+ SubnetV2.from_subnet_v2_attributes(self, "ImportedSubnet",
470
+ subnet_id="subnet-0123456789abcdef0",
471
+ availability_zone="us-west-2a",
472
+ ipv4_cidr_block="10.2.0.0/24",
473
+ route_table_id="rtb-0871c310f98da2cbb",
474
+ subnet_type=SubnetType.PRIVATE_ISOLATED
475
+ )
476
+ ```
477
+
478
+ By importing existing VPCs and subnets, you can easily integrate your existing AWS infrastructure with new resources created through CDK. This is particularly useful when you need to work with pre-existing network configurations or when you're migrating existing infrastructure to CDK.
362
479
  '''
363
480
  from pkgutil import extend_path
364
481
  __path__ = extend_path(__path__, __name__)
@@ -715,6 +832,15 @@ class IIpamPool(typing_extensions.Protocol):
715
832
  '''
716
833
  ...
717
834
 
835
+ @builtins.property
836
+ @jsii.member(jsii_name="ipamIpv4Cidrs")
837
+ def ipam_ipv4_cidrs(self) -> typing.Optional[typing.List[builtins.str]]:
838
+ '''(experimental) Pool CIDR for IPv4 to be provisioned using IPAM Required to check for subnet IP range is within the VPC range.
839
+
840
+ :stability: experimental
841
+ '''
842
+ ...
843
+
718
844
  @jsii.member(jsii_name="provisionCidr")
719
845
  def provision_cidr(
720
846
  self,
@@ -761,6 +887,15 @@ class _IIpamPoolProxy:
761
887
  '''
762
888
  return typing.cast(builtins.str, jsii.get(self, "ipamPoolId"))
763
889
 
890
+ @builtins.property
891
+ @jsii.member(jsii_name="ipamIpv4Cidrs")
892
+ def ipam_ipv4_cidrs(self) -> typing.Optional[typing.List[builtins.str]]:
893
+ '''(experimental) Pool CIDR for IPv4 to be provisioned using IPAM Required to check for subnet IP range is within the VPC range.
894
+
895
+ :stability: experimental
896
+ '''
897
+ return typing.cast(typing.Optional[typing.List[builtins.str]], jsii.get(self, "ipamIpv4Cidrs"))
898
+
764
899
  @jsii.member(jsii_name="provisionCidr")
765
900
  def provision_cidr(
766
901
  self,
@@ -1125,6 +1260,102 @@ class _ISubnetV2Proxy(
1125
1260
  typing.cast(typing.Any, ISubnetV2).__jsii_proxy_class__ = lambda : _ISubnetV2Proxy
1126
1261
 
1127
1262
 
1263
+ @jsii.interface(jsii_type="@aws-cdk/aws-ec2-alpha.IVPCCidrBlock")
1264
+ class IVPCCidrBlock(typing_extensions.Protocol):
1265
+ '''(experimental) Interface to create L2 for VPC Cidr Block.
1266
+
1267
+ :stability: experimental
1268
+ '''
1269
+
1270
+ @builtins.property
1271
+ @jsii.member(jsii_name="amazonProvidedIpv6CidrBlock")
1272
+ def amazon_provided_ipv6_cidr_block(self) -> typing.Optional[builtins.bool]:
1273
+ '''(experimental) Amazon Provided Ipv6.
1274
+
1275
+ :stability: experimental
1276
+ '''
1277
+ ...
1278
+
1279
+ @builtins.property
1280
+ @jsii.member(jsii_name="cidrBlock")
1281
+ def cidr_block(self) -> typing.Optional[builtins.str]:
1282
+ '''(experimental) The secondary IPv4 CIDR Block.
1283
+
1284
+ :default: - no CIDR block provided
1285
+
1286
+ :stability: experimental
1287
+ '''
1288
+ ...
1289
+
1290
+ @builtins.property
1291
+ @jsii.member(jsii_name="ipv4IpamPoolId")
1292
+ def ipv4_ipam_pool_id(self) -> typing.Optional[builtins.str]:
1293
+ '''(experimental) IPAM pool for IPv4 address type.
1294
+
1295
+ :stability: experimental
1296
+ '''
1297
+ ...
1298
+
1299
+ @builtins.property
1300
+ @jsii.member(jsii_name="ipv6IpamPoolId")
1301
+ def ipv6_ipam_pool_id(self) -> typing.Optional[builtins.str]:
1302
+ '''(experimental) IPAM pool for IPv6 address type.
1303
+
1304
+ :stability: experimental
1305
+ '''
1306
+ ...
1307
+
1308
+
1309
+ class _IVPCCidrBlockProxy:
1310
+ '''(experimental) Interface to create L2 for VPC Cidr Block.
1311
+
1312
+ :stability: experimental
1313
+ '''
1314
+
1315
+ __jsii_type__: typing.ClassVar[str] = "@aws-cdk/aws-ec2-alpha.IVPCCidrBlock"
1316
+
1317
+ @builtins.property
1318
+ @jsii.member(jsii_name="amazonProvidedIpv6CidrBlock")
1319
+ def amazon_provided_ipv6_cidr_block(self) -> typing.Optional[builtins.bool]:
1320
+ '''(experimental) Amazon Provided Ipv6.
1321
+
1322
+ :stability: experimental
1323
+ '''
1324
+ return typing.cast(typing.Optional[builtins.bool], jsii.get(self, "amazonProvidedIpv6CidrBlock"))
1325
+
1326
+ @builtins.property
1327
+ @jsii.member(jsii_name="cidrBlock")
1328
+ def cidr_block(self) -> typing.Optional[builtins.str]:
1329
+ '''(experimental) The secondary IPv4 CIDR Block.
1330
+
1331
+ :default: - no CIDR block provided
1332
+
1333
+ :stability: experimental
1334
+ '''
1335
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "cidrBlock"))
1336
+
1337
+ @builtins.property
1338
+ @jsii.member(jsii_name="ipv4IpamPoolId")
1339
+ def ipv4_ipam_pool_id(self) -> typing.Optional[builtins.str]:
1340
+ '''(experimental) IPAM pool for IPv4 address type.
1341
+
1342
+ :stability: experimental
1343
+ '''
1344
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "ipv4IpamPoolId"))
1345
+
1346
+ @builtins.property
1347
+ @jsii.member(jsii_name="ipv6IpamPoolId")
1348
+ def ipv6_ipam_pool_id(self) -> typing.Optional[builtins.str]:
1349
+ '''(experimental) IPAM pool for IPv6 address type.
1350
+
1351
+ :stability: experimental
1352
+ '''
1353
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "ipv6IpamPoolId"))
1354
+
1355
+ # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
1356
+ typing.cast(typing.Any, IVPCCidrBlock).__jsii_proxy_class__ = lambda : _IVPCCidrBlockProxy
1357
+
1358
+
1128
1359
  @jsii.interface(jsii_type="@aws-cdk/aws-ec2-alpha.IVpcV2")
1129
1360
  class IVpcV2(_aws_cdk_aws_ec2_ceddda9d.IVpc, typing_extensions.Protocol):
1130
1361
  '''(experimental) Placeholder to see what extra props we might need, will be added to original IVPC.
@@ -1145,11 +1376,40 @@ class IVpcV2(_aws_cdk_aws_ec2_ceddda9d.IVpc, typing_extensions.Protocol):
1145
1376
  '''
1146
1377
  ...
1147
1378
 
1379
+ @builtins.property
1380
+ @jsii.member(jsii_name="ownerAccountId")
1381
+ def owner_account_id(self) -> builtins.str:
1382
+ '''(experimental) The ID of the AWS account that owns the VPC.
1383
+
1384
+ :default: - the account id of the parent stack
1385
+
1386
+ :stability: experimental
1387
+ '''
1388
+ ...
1389
+
1390
+ @builtins.property
1391
+ @jsii.member(jsii_name="region")
1392
+ def region(self) -> builtins.str:
1393
+ '''(experimental) Optional to override inferred region.
1394
+
1395
+ :default: - current stack's environment region
1396
+
1397
+ :stability: experimental
1398
+ '''
1399
+ ...
1400
+
1401
+ @builtins.property
1402
+ @jsii.member(jsii_name="ipv4IpamProvisionedCidrs")
1403
+ def ipv4_ipam_provisioned_cidrs(self) -> typing.Optional[typing.List[builtins.str]]:
1404
+ '''(experimental) IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool.
1405
+
1406
+ :stability: experimental
1407
+ '''
1408
+ ...
1409
+
1148
1410
  @builtins.property
1149
1411
  @jsii.member(jsii_name="secondaryCidrBlock")
1150
- def secondary_cidr_block(
1151
- self,
1152
- ) -> typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock]:
1412
+ def secondary_cidr_block(self) -> typing.Optional[typing.List[IVPCCidrBlock]]:
1153
1413
  '''(experimental) The secondary CIDR blocks associated with the VPC.
1154
1414
 
1155
1415
  For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-resize}.
@@ -1280,18 +1540,47 @@ class _IVpcV2Proxy(
1280
1540
  '''
1281
1541
  return typing.cast(builtins.str, jsii.get(self, "ipv4CidrBlock"))
1282
1542
 
1543
+ @builtins.property
1544
+ @jsii.member(jsii_name="ownerAccountId")
1545
+ def owner_account_id(self) -> builtins.str:
1546
+ '''(experimental) The ID of the AWS account that owns the VPC.
1547
+
1548
+ :default: - the account id of the parent stack
1549
+
1550
+ :stability: experimental
1551
+ '''
1552
+ return typing.cast(builtins.str, jsii.get(self, "ownerAccountId"))
1553
+
1554
+ @builtins.property
1555
+ @jsii.member(jsii_name="region")
1556
+ def region(self) -> builtins.str:
1557
+ '''(experimental) Optional to override inferred region.
1558
+
1559
+ :default: - current stack's environment region
1560
+
1561
+ :stability: experimental
1562
+ '''
1563
+ return typing.cast(builtins.str, jsii.get(self, "region"))
1564
+
1565
+ @builtins.property
1566
+ @jsii.member(jsii_name="ipv4IpamProvisionedCidrs")
1567
+ def ipv4_ipam_provisioned_cidrs(self) -> typing.Optional[typing.List[builtins.str]]:
1568
+ '''(experimental) IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool.
1569
+
1570
+ :stability: experimental
1571
+ '''
1572
+ return typing.cast(typing.Optional[typing.List[builtins.str]], jsii.get(self, "ipv4IpamProvisionedCidrs"))
1573
+
1283
1574
  @builtins.property
1284
1575
  @jsii.member(jsii_name="secondaryCidrBlock")
1285
- def secondary_cidr_block(
1286
- self,
1287
- ) -> typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock]:
1576
+ def secondary_cidr_block(self) -> typing.Optional[typing.List[IVPCCidrBlock]]:
1288
1577
  '''(experimental) The secondary CIDR blocks associated with the VPC.
1289
1578
 
1290
1579
  For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-resize}.
1291
1580
 
1292
1581
  :stability: experimental
1293
1582
  '''
1294
- return typing.cast(typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock], jsii.get(self, "secondaryCidrBlock"))
1583
+ return typing.cast(typing.Optional[typing.List[IVPCCidrBlock]], jsii.get(self, "secondaryCidrBlock"))
1295
1584
 
1296
1585
  @jsii.member(jsii_name="addEgressOnlyInternetGateway")
1297
1586
  def add_egress_only_internet_gateway(
@@ -1808,7 +2097,6 @@ class IpCidr(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/aws-ec2-alpha.IpCidr")
1808
2097
 
1809
2098
  Example::
1810
2099
 
1811
- stack = Stack()
1812
2100
  my_vpc = VpcV2(self, "Vpc")
1813
2101
  route_table = RouteTable(self, "RouteTable",
1814
2102
  vpc=my_vpc
@@ -1817,13 +2105,19 @@ class IpCidr(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/aws-ec2-alpha.IpCidr")
1817
2105
  vpc=my_vpc,
1818
2106
  availability_zone="eu-west-2a",
1819
2107
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
1820
- subnet_type=SubnetType.PUBLIC
2108
+ subnet_type=SubnetType.PRIVATE_ISOLATED
1821
2109
  )
1822
2110
 
1823
- my_vpc.add_internet_gateway()
1824
- my_vpc.add_nat_gateway(
2111
+ natgw = NatGateway(self, "NatGW",
1825
2112
  subnet=subnet,
1826
- connectivity_type=NatConnectivityType.PUBLIC
2113
+ vpc=my_vpc,
2114
+ connectivity_type=NatConnectivityType.PRIVATE,
2115
+ private_ip_address="10.0.0.42"
2116
+ )
2117
+ Route(self, "NatGwRoute",
2118
+ route_table=route_table,
2119
+ destination="0.0.0.0/0",
2120
+ target={"gateway": natgw}
1827
2121
  )
1828
2122
  '''
1829
2123
 
@@ -3950,7 +4244,6 @@ class SubnetV2(
3950
4244
 
3951
4245
  Example::
3952
4246
 
3953
- stack = Stack()
3954
4247
  my_vpc = VpcV2(self, "Vpc")
3955
4248
  route_table = RouteTable(self, "RouteTable",
3956
4249
  vpc=my_vpc
@@ -3959,13 +4252,19 @@ class SubnetV2(
3959
4252
  vpc=my_vpc,
3960
4253
  availability_zone="eu-west-2a",
3961
4254
  ipv4_cidr_block=IpCidr("10.0.0.0/24"),
3962
- subnet_type=SubnetType.PUBLIC
4255
+ subnet_type=SubnetType.PRIVATE_ISOLATED
3963
4256
  )
3964
4257
 
3965
- my_vpc.add_internet_gateway()
3966
- my_vpc.add_nat_gateway(
4258
+ natgw = NatGateway(self, "NatGW",
3967
4259
  subnet=subnet,
3968
- connectivity_type=NatConnectivityType.PUBLIC
4260
+ vpc=my_vpc,
4261
+ connectivity_type=NatConnectivityType.PRIVATE,
4262
+ private_ip_address="10.0.0.42"
4263
+ )
4264
+ Route(self, "NatGwRoute",
4265
+ route_table=route_table,
4266
+ destination="0.0.0.0/0",
4267
+ target={"gateway": natgw}
3969
4268
  )
3970
4269
  '''
3971
4270
 
@@ -4015,6 +4314,51 @@ class SubnetV2(
4015
4314
 
4016
4315
  jsii.create(self.__class__, self, [scope, id, props])
4017
4316
 
4317
+ @jsii.member(jsii_name="fromSubnetV2Attributes")
4318
+ @builtins.classmethod
4319
+ def from_subnet_v2_attributes(
4320
+ cls,
4321
+ scope: _constructs_77d1e7e8.Construct,
4322
+ id: builtins.str,
4323
+ *,
4324
+ availability_zone: builtins.str,
4325
+ ipv4_cidr_block: builtins.str,
4326
+ subnet_id: builtins.str,
4327
+ subnet_type: _aws_cdk_aws_ec2_ceddda9d.SubnetType,
4328
+ ipv6_cidr_block: typing.Optional[builtins.str] = None,
4329
+ route_table_id: typing.Optional[builtins.str] = None,
4330
+ subnet_name: typing.Optional[builtins.str] = None,
4331
+ ) -> ISubnetV2:
4332
+ '''(experimental) Import an existing subnet to the VPC.
4333
+
4334
+ :param scope: -
4335
+ :param id: -
4336
+ :param availability_zone: (experimental) The Availability Zone this subnet is located in. Default: - No AZ information, cannot use AZ selection features
4337
+ :param ipv4_cidr_block: (experimental) The IPv4 CIDR block associated with the subnet. Default: - No CIDR information, cannot use CIDR filter features
4338
+ :param subnet_id: (experimental) The subnetId for this particular subnet.
4339
+ :param subnet_type: (experimental) The type of subnet (public or private) that this subnet represents.
4340
+ :param ipv6_cidr_block: (experimental) The IPv4 CIDR block associated with the subnet. Default: - No CIDR information, cannot use CIDR filter features
4341
+ :param route_table_id: (experimental) The ID of the route table for this particular subnet. Default: - No route table information, cannot create VPC endpoints
4342
+ :param subnet_name: (experimental) Name of the given subnet. Default: - no subnet name
4343
+
4344
+ :stability: experimental
4345
+ '''
4346
+ if __debug__:
4347
+ type_hints = typing.get_type_hints(_typecheckingstub__4b7efcb4a40a1cd4c8f364f2028af9d8a2b5e24d65cf7122742bca15d44a40ae)
4348
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
4349
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
4350
+ attrs = SubnetV2Attributes(
4351
+ availability_zone=availability_zone,
4352
+ ipv4_cidr_block=ipv4_cidr_block,
4353
+ subnet_id=subnet_id,
4354
+ subnet_type=subnet_type,
4355
+ ipv6_cidr_block=ipv6_cidr_block,
4356
+ route_table_id=route_table_id,
4357
+ subnet_name=subnet_name,
4358
+ )
4359
+
4360
+ return typing.cast(ISubnetV2, jsii.sinvoke(cls, "fromSubnetV2Attributes", [scope, id, attrs]))
4361
+
4018
4362
  @jsii.member(jsii_name="associateNetworkAcl")
4019
4363
  def associate_network_acl(
4020
4364
  self,
@@ -4110,88 +4454,252 @@ class SubnetV2(
4110
4454
 
4111
4455
 
4112
4456
  @jsii.data_type(
4113
- jsii_type="@aws-cdk/aws-ec2-alpha.SubnetV2Props",
4457
+ jsii_type="@aws-cdk/aws-ec2-alpha.SubnetV2Attributes",
4114
4458
  jsii_struct_bases=[],
4115
4459
  name_mapping={
4116
4460
  "availability_zone": "availabilityZone",
4117
4461
  "ipv4_cidr_block": "ipv4CidrBlock",
4462
+ "subnet_id": "subnetId",
4118
4463
  "subnet_type": "subnetType",
4119
- "vpc": "vpc",
4120
- "assign_ipv6_address_on_creation": "assignIpv6AddressOnCreation",
4121
4464
  "ipv6_cidr_block": "ipv6CidrBlock",
4122
- "route_table": "routeTable",
4465
+ "route_table_id": "routeTableId",
4123
4466
  "subnet_name": "subnetName",
4124
4467
  },
4125
4468
  )
4126
- class SubnetV2Props:
4469
+ class SubnetV2Attributes:
4127
4470
  def __init__(
4128
4471
  self,
4129
4472
  *,
4130
4473
  availability_zone: builtins.str,
4131
- ipv4_cidr_block: IpCidr,
4474
+ ipv4_cidr_block: builtins.str,
4475
+ subnet_id: builtins.str,
4132
4476
  subnet_type: _aws_cdk_aws_ec2_ceddda9d.SubnetType,
4133
- vpc: IVpcV2,
4134
- assign_ipv6_address_on_creation: typing.Optional[builtins.bool] = None,
4135
- ipv6_cidr_block: typing.Optional[IpCidr] = None,
4136
- route_table: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IRouteTable] = None,
4477
+ ipv6_cidr_block: typing.Optional[builtins.str] = None,
4478
+ route_table_id: typing.Optional[builtins.str] = None,
4137
4479
  subnet_name: typing.Optional[builtins.str] = None,
4138
4480
  ) -> None:
4139
- '''(experimental) Properties to define subnet for VPC.
4481
+ '''(experimental) Properties required to import a subnet.
4140
4482
 
4141
- :param availability_zone: (experimental) Custom AZ for the subnet.
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
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)
4144
- :param vpc: (experimental) VPC Prop.
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
4483
+ :param availability_zone: (experimental) The Availability Zone this subnet is located in. Default: - No AZ information, cannot use AZ selection features
4484
+ :param ipv4_cidr_block: (experimental) The IPv4 CIDR block associated with the subnet. Default: - No CIDR information, cannot use CIDR filter features
4485
+ :param subnet_id: (experimental) The subnetId for this particular subnet.
4486
+ :param subnet_type: (experimental) The type of subnet (public or private) that this subnet represents.
4487
+ :param ipv6_cidr_block: (experimental) The IPv4 CIDR block associated with the subnet. Default: - No CIDR information, cannot use CIDR filter features
4488
+ :param route_table_id: (experimental) The ID of the route table for this particular subnet. Default: - No route table information, cannot create VPC endpoints
4489
+ :param subnet_name: (experimental) Name of the given subnet. Default: - no subnet name
4149
4490
 
4150
4491
  :stability: experimental
4151
4492
  :exampleMetadata: infused
4152
4493
 
4153
4494
  Example::
4154
4495
 
4155
- stack = Stack()
4156
- my_vpc = VpcV2(self, "Vpc")
4157
- route_table = RouteTable(self, "RouteTable",
4158
- vpc=my_vpc
4159
- )
4160
- subnet = SubnetV2(self, "Subnet",
4161
- vpc=my_vpc,
4162
- availability_zone="eu-west-2a",
4163
- ipv4_cidr_block=IpCidr("10.0.0.0/24"),
4164
- subnet_type=SubnetType.PUBLIC
4165
- )
4166
-
4167
- my_vpc.add_internet_gateway()
4168
- my_vpc.add_nat_gateway(
4169
- subnet=subnet,
4170
- connectivity_type=NatConnectivityType.PUBLIC
4496
+ SubnetV2.from_subnet_v2_attributes(self, "ImportedSubnet",
4497
+ subnet_id="subnet-0123456789abcdef0",
4498
+ availability_zone="us-west-2a",
4499
+ ipv4_cidr_block="10.2.0.0/24",
4500
+ route_table_id="rtb-0871c310f98da2cbb",
4501
+ subnet_type=SubnetType.PRIVATE_ISOLATED
4171
4502
  )
4172
4503
  '''
4173
4504
  if __debug__:
4174
- type_hints = typing.get_type_hints(_typecheckingstub__95ce99f8025433ac8b79825abef6ff91da4dfd0693fd24dadedcee63eb93d668)
4505
+ type_hints = typing.get_type_hints(_typecheckingstub__d1c1c485159a040f312fb9bac0ed6195b5a11d0519ac42081997619b64a0858c)
4175
4506
  check_type(argname="argument availability_zone", value=availability_zone, expected_type=type_hints["availability_zone"])
4176
4507
  check_type(argname="argument ipv4_cidr_block", value=ipv4_cidr_block, expected_type=type_hints["ipv4_cidr_block"])
4508
+ check_type(argname="argument subnet_id", value=subnet_id, expected_type=type_hints["subnet_id"])
4177
4509
  check_type(argname="argument subnet_type", value=subnet_type, expected_type=type_hints["subnet_type"])
4178
- check_type(argname="argument vpc", value=vpc, expected_type=type_hints["vpc"])
4179
- check_type(argname="argument assign_ipv6_address_on_creation", value=assign_ipv6_address_on_creation, expected_type=type_hints["assign_ipv6_address_on_creation"])
4180
4510
  check_type(argname="argument ipv6_cidr_block", value=ipv6_cidr_block, expected_type=type_hints["ipv6_cidr_block"])
4181
- check_type(argname="argument route_table", value=route_table, expected_type=type_hints["route_table"])
4511
+ check_type(argname="argument route_table_id", value=route_table_id, expected_type=type_hints["route_table_id"])
4182
4512
  check_type(argname="argument subnet_name", value=subnet_name, expected_type=type_hints["subnet_name"])
4183
4513
  self._values: typing.Dict[builtins.str, typing.Any] = {
4184
4514
  "availability_zone": availability_zone,
4185
4515
  "ipv4_cidr_block": ipv4_cidr_block,
4516
+ "subnet_id": subnet_id,
4186
4517
  "subnet_type": subnet_type,
4187
- "vpc": vpc,
4188
4518
  }
4189
- if assign_ipv6_address_on_creation is not None:
4190
- self._values["assign_ipv6_address_on_creation"] = assign_ipv6_address_on_creation
4191
4519
  if ipv6_cidr_block is not None:
4192
4520
  self._values["ipv6_cidr_block"] = ipv6_cidr_block
4193
- if route_table is not None:
4194
- self._values["route_table"] = route_table
4521
+ if route_table_id is not None:
4522
+ self._values["route_table_id"] = route_table_id
4523
+ if subnet_name is not None:
4524
+ self._values["subnet_name"] = subnet_name
4525
+
4526
+ @builtins.property
4527
+ def availability_zone(self) -> builtins.str:
4528
+ '''(experimental) The Availability Zone this subnet is located in.
4529
+
4530
+ :default: - No AZ information, cannot use AZ selection features
4531
+
4532
+ :stability: experimental
4533
+ '''
4534
+ result = self._values.get("availability_zone")
4535
+ assert result is not None, "Required property 'availability_zone' is missing"
4536
+ return typing.cast(builtins.str, result)
4537
+
4538
+ @builtins.property
4539
+ def ipv4_cidr_block(self) -> builtins.str:
4540
+ '''(experimental) The IPv4 CIDR block associated with the subnet.
4541
+
4542
+ :default: - No CIDR information, cannot use CIDR filter features
4543
+
4544
+ :stability: experimental
4545
+ '''
4546
+ result = self._values.get("ipv4_cidr_block")
4547
+ assert result is not None, "Required property 'ipv4_cidr_block' is missing"
4548
+ return typing.cast(builtins.str, result)
4549
+
4550
+ @builtins.property
4551
+ def subnet_id(self) -> builtins.str:
4552
+ '''(experimental) The subnetId for this particular subnet.
4553
+
4554
+ :stability: experimental
4555
+ '''
4556
+ result = self._values.get("subnet_id")
4557
+ assert result is not None, "Required property 'subnet_id' is missing"
4558
+ return typing.cast(builtins.str, result)
4559
+
4560
+ @builtins.property
4561
+ def subnet_type(self) -> _aws_cdk_aws_ec2_ceddda9d.SubnetType:
4562
+ '''(experimental) The type of subnet (public or private) that this subnet represents.
4563
+
4564
+ :stability: experimental
4565
+ '''
4566
+ result = self._values.get("subnet_type")
4567
+ assert result is not None, "Required property 'subnet_type' is missing"
4568
+ return typing.cast(_aws_cdk_aws_ec2_ceddda9d.SubnetType, result)
4569
+
4570
+ @builtins.property
4571
+ def ipv6_cidr_block(self) -> typing.Optional[builtins.str]:
4572
+ '''(experimental) The IPv4 CIDR block associated with the subnet.
4573
+
4574
+ :default: - No CIDR information, cannot use CIDR filter features
4575
+
4576
+ :stability: experimental
4577
+ '''
4578
+ result = self._values.get("ipv6_cidr_block")
4579
+ return typing.cast(typing.Optional[builtins.str], result)
4580
+
4581
+ @builtins.property
4582
+ def route_table_id(self) -> typing.Optional[builtins.str]:
4583
+ '''(experimental) The ID of the route table for this particular subnet.
4584
+
4585
+ :default: - No route table information, cannot create VPC endpoints
4586
+
4587
+ :stability: experimental
4588
+ '''
4589
+ result = self._values.get("route_table_id")
4590
+ return typing.cast(typing.Optional[builtins.str], result)
4591
+
4592
+ @builtins.property
4593
+ def subnet_name(self) -> typing.Optional[builtins.str]:
4594
+ '''(experimental) Name of the given subnet.
4595
+
4596
+ :default: - no subnet name
4597
+
4598
+ :stability: experimental
4599
+ '''
4600
+ result = self._values.get("subnet_name")
4601
+ return typing.cast(typing.Optional[builtins.str], result)
4602
+
4603
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
4604
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
4605
+
4606
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
4607
+ return not (rhs == self)
4608
+
4609
+ def __repr__(self) -> str:
4610
+ return "SubnetV2Attributes(%s)" % ", ".join(
4611
+ k + "=" + repr(v) for k, v in self._values.items()
4612
+ )
4613
+
4614
+
4615
+ @jsii.data_type(
4616
+ jsii_type="@aws-cdk/aws-ec2-alpha.SubnetV2Props",
4617
+ jsii_struct_bases=[],
4618
+ name_mapping={
4619
+ "availability_zone": "availabilityZone",
4620
+ "ipv4_cidr_block": "ipv4CidrBlock",
4621
+ "subnet_type": "subnetType",
4622
+ "vpc": "vpc",
4623
+ "assign_ipv6_address_on_creation": "assignIpv6AddressOnCreation",
4624
+ "ipv6_cidr_block": "ipv6CidrBlock",
4625
+ "route_table": "routeTable",
4626
+ "subnet_name": "subnetName",
4627
+ },
4628
+ )
4629
+ class SubnetV2Props:
4630
+ def __init__(
4631
+ self,
4632
+ *,
4633
+ availability_zone: builtins.str,
4634
+ ipv4_cidr_block: IpCidr,
4635
+ subnet_type: _aws_cdk_aws_ec2_ceddda9d.SubnetType,
4636
+ vpc: IVpcV2,
4637
+ assign_ipv6_address_on_creation: typing.Optional[builtins.bool] = None,
4638
+ ipv6_cidr_block: typing.Optional[IpCidr] = None,
4639
+ route_table: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IRouteTable] = None,
4640
+ subnet_name: typing.Optional[builtins.str] = None,
4641
+ ) -> None:
4642
+ '''(experimental) Properties to define subnet for VPC.
4643
+
4644
+ :param availability_zone: (experimental) Custom AZ for the subnet.
4645
+ :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
4646
+ :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)
4647
+ :param vpc: (experimental) VPC Prop.
4648
+ :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
4649
+ :param ipv6_cidr_block: (experimental) Ipv6 CIDR Range for subnet. Default: - No Ipv6 address
4650
+ :param route_table: (experimental) Custom Route for subnet. Default: - a default route table created
4651
+ :param subnet_name: (experimental) Subnet name. Default: - provisioned with an autogenerated name by CDK
4652
+
4653
+ :stability: experimental
4654
+ :exampleMetadata: infused
4655
+
4656
+ Example::
4657
+
4658
+ my_vpc = VpcV2(self, "Vpc")
4659
+ route_table = RouteTable(self, "RouteTable",
4660
+ vpc=my_vpc
4661
+ )
4662
+ subnet = SubnetV2(self, "Subnet",
4663
+ vpc=my_vpc,
4664
+ availability_zone="eu-west-2a",
4665
+ ipv4_cidr_block=IpCidr("10.0.0.0/24"),
4666
+ subnet_type=SubnetType.PRIVATE_ISOLATED
4667
+ )
4668
+
4669
+ natgw = NatGateway(self, "NatGW",
4670
+ subnet=subnet,
4671
+ vpc=my_vpc,
4672
+ connectivity_type=NatConnectivityType.PRIVATE,
4673
+ private_ip_address="10.0.0.42"
4674
+ )
4675
+ Route(self, "NatGwRoute",
4676
+ route_table=route_table,
4677
+ destination="0.0.0.0/0",
4678
+ target={"gateway": natgw}
4679
+ )
4680
+ '''
4681
+ if __debug__:
4682
+ type_hints = typing.get_type_hints(_typecheckingstub__95ce99f8025433ac8b79825abef6ff91da4dfd0693fd24dadedcee63eb93d668)
4683
+ check_type(argname="argument availability_zone", value=availability_zone, expected_type=type_hints["availability_zone"])
4684
+ check_type(argname="argument ipv4_cidr_block", value=ipv4_cidr_block, expected_type=type_hints["ipv4_cidr_block"])
4685
+ check_type(argname="argument subnet_type", value=subnet_type, expected_type=type_hints["subnet_type"])
4686
+ check_type(argname="argument vpc", value=vpc, expected_type=type_hints["vpc"])
4687
+ check_type(argname="argument assign_ipv6_address_on_creation", value=assign_ipv6_address_on_creation, expected_type=type_hints["assign_ipv6_address_on_creation"])
4688
+ check_type(argname="argument ipv6_cidr_block", value=ipv6_cidr_block, expected_type=type_hints["ipv6_cidr_block"])
4689
+ check_type(argname="argument route_table", value=route_table, expected_type=type_hints["route_table"])
4690
+ check_type(argname="argument subnet_name", value=subnet_name, expected_type=type_hints["subnet_name"])
4691
+ self._values: typing.Dict[builtins.str, typing.Any] = {
4692
+ "availability_zone": availability_zone,
4693
+ "ipv4_cidr_block": ipv4_cidr_block,
4694
+ "subnet_type": subnet_type,
4695
+ "vpc": vpc,
4696
+ }
4697
+ if assign_ipv6_address_on_creation is not None:
4698
+ self._values["assign_ipv6_address_on_creation"] = assign_ipv6_address_on_creation
4699
+ if ipv6_cidr_block is not None:
4700
+ self._values["ipv6_cidr_block"] = ipv6_cidr_block
4701
+ if route_table is not None:
4702
+ self._values["route_table"] = route_table
4195
4703
  if subnet_name is not None:
4196
4704
  self._values["subnet_name"] = subnet_name
4197
4705
 
@@ -4256,37 +4764,223 @@ class SubnetV2Props:
4256
4764
  return typing.cast(typing.Optional[builtins.bool], result)
4257
4765
 
4258
4766
  @builtins.property
4259
- def ipv6_cidr_block(self) -> typing.Optional[IpCidr]:
4260
- '''(experimental) Ipv6 CIDR Range for subnet.
4767
+ def ipv6_cidr_block(self) -> typing.Optional[IpCidr]:
4768
+ '''(experimental) Ipv6 CIDR Range for subnet.
4769
+
4770
+ :default: - No Ipv6 address
4771
+
4772
+ :stability: experimental
4773
+ '''
4774
+ result = self._values.get("ipv6_cidr_block")
4775
+ return typing.cast(typing.Optional[IpCidr], result)
4776
+
4777
+ @builtins.property
4778
+ def route_table(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IRouteTable]:
4779
+ '''(experimental) Custom Route for subnet.
4780
+
4781
+ :default: - a default route table created
4782
+
4783
+ :stability: experimental
4784
+ '''
4785
+ result = self._values.get("route_table")
4786
+ return typing.cast(typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IRouteTable], result)
4787
+
4788
+ @builtins.property
4789
+ def subnet_name(self) -> typing.Optional[builtins.str]:
4790
+ '''(experimental) Subnet name.
4791
+
4792
+ :default: - provisioned with an autogenerated name by CDK
4793
+
4794
+ :stability: experimental
4795
+ '''
4796
+ result = self._values.get("subnet_name")
4797
+ return typing.cast(typing.Optional[builtins.str], result)
4798
+
4799
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
4800
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
4801
+
4802
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
4803
+ return not (rhs == self)
4804
+
4805
+ def __repr__(self) -> str:
4806
+ return "SubnetV2Props(%s)" % ", ".join(
4807
+ k + "=" + repr(v) for k, v in self._values.items()
4808
+ )
4809
+
4810
+
4811
+ @jsii.data_type(
4812
+ jsii_type="@aws-cdk/aws-ec2-alpha.VPCCidrBlockattributes",
4813
+ jsii_struct_bases=[],
4814
+ name_mapping={
4815
+ "amazon_provided_ipv6_cidr_block": "amazonProvidedIpv6CidrBlock",
4816
+ "cidr_block": "cidrBlock",
4817
+ "cidr_block_name": "cidrBlockName",
4818
+ "ipv4_ipam_pool_id": "ipv4IpamPoolId",
4819
+ "ipv4_ipam_provisioned_cidrs": "ipv4IpamProvisionedCidrs",
4820
+ "ipv4_netmask_length": "ipv4NetmaskLength",
4821
+ "ipv6_ipam_pool_id": "ipv6IpamPoolId",
4822
+ "ipv6_netmask_length": "ipv6NetmaskLength",
4823
+ },
4824
+ )
4825
+ class VPCCidrBlockattributes:
4826
+ def __init__(
4827
+ self,
4828
+ *,
4829
+ amazon_provided_ipv6_cidr_block: typing.Optional[builtins.bool] = None,
4830
+ cidr_block: typing.Optional[builtins.str] = None,
4831
+ cidr_block_name: typing.Optional[builtins.str] = None,
4832
+ ipv4_ipam_pool_id: typing.Optional[builtins.str] = None,
4833
+ ipv4_ipam_provisioned_cidrs: typing.Optional[typing.Sequence[builtins.str]] = None,
4834
+ ipv4_netmask_length: typing.Optional[jsii.Number] = None,
4835
+ ipv6_ipam_pool_id: typing.Optional[builtins.str] = None,
4836
+ ipv6_netmask_length: typing.Optional[jsii.Number] = None,
4837
+ ) -> None:
4838
+ '''(experimental) Attributes for VPCCidrBlock used for defining a new CIDR Block and also for importing an existing CIDR.
4839
+
4840
+ :param amazon_provided_ipv6_cidr_block: (experimental) Amazon Provided Ipv6. Default: false
4841
+ :param cidr_block: (experimental) The secondary IPv4 CIDR Block. Default: - no CIDR block provided
4842
+ :param cidr_block_name: (experimental) The secondary IPv4 CIDR Block. Default: - no CIDR block provided
4843
+ :param ipv4_ipam_pool_id: (experimental) IPAM pool for IPv4 address type. Default: - no IPAM pool Id provided for IPv4
4844
+ :param ipv4_ipam_provisioned_cidrs: (experimental) IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool. Default: - no IPAM IPv4 CIDR range is provisioned using IPAM
4845
+ :param ipv4_netmask_length: (experimental) Net mask length for IPv4 address type. Default: - no Net mask length configured for IPv4
4846
+ :param ipv6_ipam_pool_id: (experimental) IPAM pool for IPv6 address type. Default: - no IPAM pool Id provided for IPv6
4847
+ :param ipv6_netmask_length: (experimental) Net mask length for IPv6 address type. Default: - no Net mask length configured for IPv6
4848
+
4849
+ :stability: experimental
4850
+ :exampleMetadata: fixture=_generated
4851
+
4852
+ Example::
4853
+
4854
+ # The code below shows an example of how to instantiate this type.
4855
+ # The values are placeholders you should change.
4856
+ import aws_cdk.aws_ec2_alpha as ec2_alpha
4857
+
4858
+ v_pCCidr_blockattributes = ec2_alpha.VPCCidrBlockattributes(
4859
+ amazon_provided_ipv6_cidr_block=False,
4860
+ cidr_block="cidrBlock",
4861
+ cidr_block_name="cidrBlockName",
4862
+ ipv4_ipam_pool_id="ipv4IpamPoolId",
4863
+ ipv4_ipam_provisioned_cidrs=["ipv4IpamProvisionedCidrs"],
4864
+ ipv4_netmask_length=123,
4865
+ ipv6_ipam_pool_id="ipv6IpamPoolId",
4866
+ ipv6_netmask_length=123
4867
+ )
4868
+ '''
4869
+ if __debug__:
4870
+ type_hints = typing.get_type_hints(_typecheckingstub__4302f03d1c3aa687fb9a6d3011f239c94d844badf36d9d2e8270a543f80a5d49)
4871
+ check_type(argname="argument amazon_provided_ipv6_cidr_block", value=amazon_provided_ipv6_cidr_block, expected_type=type_hints["amazon_provided_ipv6_cidr_block"])
4872
+ check_type(argname="argument cidr_block", value=cidr_block, expected_type=type_hints["cidr_block"])
4873
+ check_type(argname="argument cidr_block_name", value=cidr_block_name, expected_type=type_hints["cidr_block_name"])
4874
+ check_type(argname="argument ipv4_ipam_pool_id", value=ipv4_ipam_pool_id, expected_type=type_hints["ipv4_ipam_pool_id"])
4875
+ check_type(argname="argument ipv4_ipam_provisioned_cidrs", value=ipv4_ipam_provisioned_cidrs, expected_type=type_hints["ipv4_ipam_provisioned_cidrs"])
4876
+ check_type(argname="argument ipv4_netmask_length", value=ipv4_netmask_length, expected_type=type_hints["ipv4_netmask_length"])
4877
+ check_type(argname="argument ipv6_ipam_pool_id", value=ipv6_ipam_pool_id, expected_type=type_hints["ipv6_ipam_pool_id"])
4878
+ check_type(argname="argument ipv6_netmask_length", value=ipv6_netmask_length, expected_type=type_hints["ipv6_netmask_length"])
4879
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
4880
+ if amazon_provided_ipv6_cidr_block is not None:
4881
+ self._values["amazon_provided_ipv6_cidr_block"] = amazon_provided_ipv6_cidr_block
4882
+ if cidr_block is not None:
4883
+ self._values["cidr_block"] = cidr_block
4884
+ if cidr_block_name is not None:
4885
+ self._values["cidr_block_name"] = cidr_block_name
4886
+ if ipv4_ipam_pool_id is not None:
4887
+ self._values["ipv4_ipam_pool_id"] = ipv4_ipam_pool_id
4888
+ if ipv4_ipam_provisioned_cidrs is not None:
4889
+ self._values["ipv4_ipam_provisioned_cidrs"] = ipv4_ipam_provisioned_cidrs
4890
+ if ipv4_netmask_length is not None:
4891
+ self._values["ipv4_netmask_length"] = ipv4_netmask_length
4892
+ if ipv6_ipam_pool_id is not None:
4893
+ self._values["ipv6_ipam_pool_id"] = ipv6_ipam_pool_id
4894
+ if ipv6_netmask_length is not None:
4895
+ self._values["ipv6_netmask_length"] = ipv6_netmask_length
4896
+
4897
+ @builtins.property
4898
+ def amazon_provided_ipv6_cidr_block(self) -> typing.Optional[builtins.bool]:
4899
+ '''(experimental) Amazon Provided Ipv6.
4900
+
4901
+ :default: false
4902
+
4903
+ :stability: experimental
4904
+ '''
4905
+ result = self._values.get("amazon_provided_ipv6_cidr_block")
4906
+ return typing.cast(typing.Optional[builtins.bool], result)
4907
+
4908
+ @builtins.property
4909
+ def cidr_block(self) -> typing.Optional[builtins.str]:
4910
+ '''(experimental) The secondary IPv4 CIDR Block.
4911
+
4912
+ :default: - no CIDR block provided
4913
+
4914
+ :stability: experimental
4915
+ '''
4916
+ result = self._values.get("cidr_block")
4917
+ return typing.cast(typing.Optional[builtins.str], result)
4918
+
4919
+ @builtins.property
4920
+ def cidr_block_name(self) -> typing.Optional[builtins.str]:
4921
+ '''(experimental) The secondary IPv4 CIDR Block.
4922
+
4923
+ :default: - no CIDR block provided
4924
+
4925
+ :stability: experimental
4926
+ '''
4927
+ result = self._values.get("cidr_block_name")
4928
+ return typing.cast(typing.Optional[builtins.str], result)
4929
+
4930
+ @builtins.property
4931
+ def ipv4_ipam_pool_id(self) -> typing.Optional[builtins.str]:
4932
+ '''(experimental) IPAM pool for IPv4 address type.
4933
+
4934
+ :default: - no IPAM pool Id provided for IPv4
4935
+
4936
+ :stability: experimental
4937
+ '''
4938
+ result = self._values.get("ipv4_ipam_pool_id")
4939
+ return typing.cast(typing.Optional[builtins.str], result)
4940
+
4941
+ @builtins.property
4942
+ def ipv4_ipam_provisioned_cidrs(self) -> typing.Optional[typing.List[builtins.str]]:
4943
+ '''(experimental) IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool.
4944
+
4945
+ :default: - no IPAM IPv4 CIDR range is provisioned using IPAM
4946
+
4947
+ :stability: experimental
4948
+ '''
4949
+ result = self._values.get("ipv4_ipam_provisioned_cidrs")
4950
+ return typing.cast(typing.Optional[typing.List[builtins.str]], result)
4951
+
4952
+ @builtins.property
4953
+ def ipv4_netmask_length(self) -> typing.Optional[jsii.Number]:
4954
+ '''(experimental) Net mask length for IPv4 address type.
4261
4955
 
4262
- :default: - No Ipv6 address
4956
+ :default: - no Net mask length configured for IPv4
4263
4957
 
4264
4958
  :stability: experimental
4265
4959
  '''
4266
- result = self._values.get("ipv6_cidr_block")
4267
- return typing.cast(typing.Optional[IpCidr], result)
4960
+ result = self._values.get("ipv4_netmask_length")
4961
+ return typing.cast(typing.Optional[jsii.Number], result)
4268
4962
 
4269
4963
  @builtins.property
4270
- def route_table(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IRouteTable]:
4271
- '''(experimental) Custom Route for subnet.
4964
+ def ipv6_ipam_pool_id(self) -> typing.Optional[builtins.str]:
4965
+ '''(experimental) IPAM pool for IPv6 address type.
4272
4966
 
4273
- :default: - a default route table created
4967
+ :default: - no IPAM pool Id provided for IPv6
4274
4968
 
4275
4969
  :stability: experimental
4276
4970
  '''
4277
- result = self._values.get("route_table")
4278
- return typing.cast(typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IRouteTable], result)
4971
+ result = self._values.get("ipv6_ipam_pool_id")
4972
+ return typing.cast(typing.Optional[builtins.str], result)
4279
4973
 
4280
4974
  @builtins.property
4281
- def subnet_name(self) -> typing.Optional[builtins.str]:
4282
- '''(experimental) Subnet name.
4975
+ def ipv6_netmask_length(self) -> typing.Optional[jsii.Number]:
4976
+ '''(experimental) Net mask length for IPv6 address type.
4283
4977
 
4284
- :default: - provisioned with an autogenerated name by CDK
4978
+ :default: - no Net mask length configured for IPv6
4285
4979
 
4286
4980
  :stability: experimental
4287
4981
  '''
4288
- result = self._values.get("subnet_name")
4289
- return typing.cast(typing.Optional[builtins.str], result)
4982
+ result = self._values.get("ipv6_netmask_length")
4983
+ return typing.cast(typing.Optional[jsii.Number], result)
4290
4984
 
4291
4985
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
4292
4986
  return isinstance(rhs, self.__class__) and rhs._values == self._values
@@ -4295,7 +4989,7 @@ class SubnetV2Props:
4295
4989
  return not (rhs == self)
4296
4990
 
4297
4991
  def __repr__(self) -> str:
4298
- return "SubnetV2Props(%s)" % ", ".join(
4992
+ return "VPCCidrBlockattributes(%s)" % ", ".join(
4299
4993
  k + "=" + repr(v) for k, v in self._values.items()
4300
4994
  )
4301
4995
 
@@ -4682,6 +5376,7 @@ class VPNGatewayV2Props(VPNGatewayV2Options):
4682
5376
  "dependencies": "dependencies",
4683
5377
  "ipv4_cidr_block": "ipv4CidrBlock",
4684
5378
  "ipv4_ipam_pool": "ipv4IpamPool",
5379
+ "ipv4_ipam_provisioned_cidrs": "ipv4IpamProvisionedCidrs",
4685
5380
  "ipv4_netmask_length": "ipv4NetmaskLength",
4686
5381
  "ipv6_ipam_pool": "ipv6IpamPool",
4687
5382
  "ipv6_netmask_length": "ipv6NetmaskLength",
@@ -4696,6 +5391,7 @@ class VpcCidrOptions:
4696
5391
  dependencies: typing.Optional[typing.Sequence[_aws_cdk_ceddda9d.CfnResource]] = None,
4697
5392
  ipv4_cidr_block: typing.Optional[builtins.str] = None,
4698
5393
  ipv4_ipam_pool: typing.Optional[IIpamPool] = None,
5394
+ ipv4_ipam_provisioned_cidrs: typing.Optional[typing.Sequence[builtins.str]] = None,
4699
5395
  ipv4_netmask_length: typing.Optional[jsii.Number] = None,
4700
5396
  ipv6_ipam_pool: typing.Optional[IIpamPool] = None,
4701
5397
  ipv6_netmask_length: typing.Optional[jsii.Number] = None,
@@ -4707,6 +5403,7 @@ class VpcCidrOptions:
4707
5403
  :param dependencies: (experimental) Dependency to associate Ipv6 CIDR block. Default: - No dependency
4708
5404
  :param ipv4_cidr_block: (experimental) IPv4 CIDR Block. Default: '10.0.0.0/16'
4709
5405
  :param ipv4_ipam_pool: (experimental) Ipv4 IPAM Pool. Default: - Only required when using IPAM Ipv4
5406
+ :param ipv4_ipam_provisioned_cidrs: (experimental) IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool. Default: - no IPAM IPv4 CIDR range is provisioned using IPAM
4710
5407
  :param ipv4_netmask_length: (experimental) CIDR Mask for Vpc. Default: - Only required when using IPAM Ipv4
4711
5408
  :param ipv6_ipam_pool: (experimental) Ipv6 IPAM pool id for VPC range, can only be defined under public scope. Default: - no pool id
4712
5409
  :param ipv6_netmask_length: (experimental) CIDR Mask for Vpc. Default: - Only required when using AWS Ipam
@@ -4730,6 +5427,7 @@ class VpcCidrOptions:
4730
5427
  dependencies=[cfn_resource],
4731
5428
  ipv4_cidr_block="ipv4CidrBlock",
4732
5429
  ipv4_ipam_pool=ipam_pool,
5430
+ ipv4_ipam_provisioned_cidrs=["ipv4IpamProvisionedCidrs"],
4733
5431
  ipv4_netmask_length=123,
4734
5432
  ipv6_ipam_pool=ipam_pool,
4735
5433
  ipv6_netmask_length=123
@@ -4742,6 +5440,7 @@ class VpcCidrOptions:
4742
5440
  check_type(argname="argument dependencies", value=dependencies, expected_type=type_hints["dependencies"])
4743
5441
  check_type(argname="argument ipv4_cidr_block", value=ipv4_cidr_block, expected_type=type_hints["ipv4_cidr_block"])
4744
5442
  check_type(argname="argument ipv4_ipam_pool", value=ipv4_ipam_pool, expected_type=type_hints["ipv4_ipam_pool"])
5443
+ check_type(argname="argument ipv4_ipam_provisioned_cidrs", value=ipv4_ipam_provisioned_cidrs, expected_type=type_hints["ipv4_ipam_provisioned_cidrs"])
4745
5444
  check_type(argname="argument ipv4_netmask_length", value=ipv4_netmask_length, expected_type=type_hints["ipv4_netmask_length"])
4746
5445
  check_type(argname="argument ipv6_ipam_pool", value=ipv6_ipam_pool, expected_type=type_hints["ipv6_ipam_pool"])
4747
5446
  check_type(argname="argument ipv6_netmask_length", value=ipv6_netmask_length, expected_type=type_hints["ipv6_netmask_length"])
@@ -4756,6 +5455,8 @@ class VpcCidrOptions:
4756
5455
  self._values["ipv4_cidr_block"] = ipv4_cidr_block
4757
5456
  if ipv4_ipam_pool is not None:
4758
5457
  self._values["ipv4_ipam_pool"] = ipv4_ipam_pool
5458
+ if ipv4_ipam_provisioned_cidrs is not None:
5459
+ self._values["ipv4_ipam_provisioned_cidrs"] = ipv4_ipam_provisioned_cidrs
4759
5460
  if ipv4_netmask_length is not None:
4760
5461
  self._values["ipv4_netmask_length"] = ipv4_netmask_length
4761
5462
  if ipv6_ipam_pool is not None:
@@ -4820,6 +5521,17 @@ class VpcCidrOptions:
4820
5521
  result = self._values.get("ipv4_ipam_pool")
4821
5522
  return typing.cast(typing.Optional[IIpamPool], result)
4822
5523
 
5524
+ @builtins.property
5525
+ def ipv4_ipam_provisioned_cidrs(self) -> typing.Optional[typing.List[builtins.str]]:
5526
+ '''(experimental) IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool.
5527
+
5528
+ :default: - no IPAM IPv4 CIDR range is provisioned using IPAM
5529
+
5530
+ :stability: experimental
5531
+ '''
5532
+ result = self._values.get("ipv4_ipam_provisioned_cidrs")
5533
+ return typing.cast(typing.Optional[typing.List[builtins.str]], result)
5534
+
4823
5535
  @builtins.property
4824
5536
  def ipv4_netmask_length(self) -> typing.Optional[jsii.Number]:
4825
5537
  '''(experimental) CIDR Mask for Vpc.
@@ -4865,6 +5577,169 @@ class VpcCidrOptions:
4865
5577
  )
4866
5578
 
4867
5579
 
5580
+ @jsii.data_type(
5581
+ jsii_type="@aws-cdk/aws-ec2-alpha.VpcV2Attributes",
5582
+ jsii_struct_bases=[],
5583
+ name_mapping={
5584
+ "vpc_cidr_block": "vpcCidrBlock",
5585
+ "vpc_id": "vpcId",
5586
+ "owner_account_id": "ownerAccountId",
5587
+ "region": "region",
5588
+ "secondary_cidr_blocks": "secondaryCidrBlocks",
5589
+ "subnets": "subnets",
5590
+ "vpn_gateway_id": "vpnGatewayId",
5591
+ },
5592
+ )
5593
+ class VpcV2Attributes:
5594
+ def __init__(
5595
+ self,
5596
+ *,
5597
+ vpc_cidr_block: builtins.str,
5598
+ vpc_id: builtins.str,
5599
+ owner_account_id: typing.Optional[builtins.str] = None,
5600
+ region: typing.Optional[builtins.str] = None,
5601
+ secondary_cidr_blocks: typing.Optional[typing.Sequence[typing.Union[VPCCidrBlockattributes, typing.Dict[builtins.str, typing.Any]]]] = None,
5602
+ subnets: typing.Optional[typing.Sequence[typing.Union[SubnetV2Attributes, typing.Dict[builtins.str, typing.Any]]]] = None,
5603
+ vpn_gateway_id: typing.Optional[builtins.str] = None,
5604
+ ) -> None:
5605
+ '''(experimental) Options to import a VPC created outside of CDK stack.
5606
+
5607
+ :param vpc_cidr_block: (experimental) Primary VPC CIDR Block of the imported VPC Can only be IPv4.
5608
+ :param vpc_id: (experimental) The VPC ID Refers to physical Id of the resource.
5609
+ :param owner_account_id: (experimental) The ID of the AWS account that owns the imported VPC required in case of cross account VPC as given value will be used to set field account for imported VPC, which then later can be used for establishing VPC peering connection. Default: - constructed with stack account value
5610
+ :param region: (experimental) Region in which imported VPC is hosted required in case of cross region VPC as given value will be used to set field region for imported VPC, which then later can be used for establishing VPC peering connection. Default: - constructed with stack region value
5611
+ :param secondary_cidr_blocks: (experimental) Import Secondary CIDR blocks associated with VPC. Default: - No secondary IP address
5612
+ :param subnets: (experimental) Subnets associated with imported VPC. Default: - no subnets provided to be imported
5613
+ :param vpn_gateway_id: (experimental) A VPN Gateway is attached to the VPC. Default: - No VPN Gateway
5614
+
5615
+ :stability: experimental
5616
+ :exampleMetadata: infused
5617
+
5618
+ Example::
5619
+
5620
+ stack = Stack()
5621
+
5622
+ # Importing a cross acount or cross region VPC
5623
+ imported_vpc = VpcV2.from_vpc_v2_attributes(stack, "ImportedVpc",
5624
+ vpc_id="mockVpcID",
5625
+ vpc_cidr_block="10.0.0.0/16",
5626
+ owner_account_id="123456789012",
5627
+ region="us-west-2"
5628
+ )
5629
+ '''
5630
+ if __debug__:
5631
+ type_hints = typing.get_type_hints(_typecheckingstub__456e1aed5fd7b92e9fe1ffc4615970b62870dbb14e689177f2fdb104f3200b6b)
5632
+ check_type(argname="argument vpc_cidr_block", value=vpc_cidr_block, expected_type=type_hints["vpc_cidr_block"])
5633
+ check_type(argname="argument vpc_id", value=vpc_id, expected_type=type_hints["vpc_id"])
5634
+ check_type(argname="argument owner_account_id", value=owner_account_id, expected_type=type_hints["owner_account_id"])
5635
+ check_type(argname="argument region", value=region, expected_type=type_hints["region"])
5636
+ check_type(argname="argument secondary_cidr_blocks", value=secondary_cidr_blocks, expected_type=type_hints["secondary_cidr_blocks"])
5637
+ check_type(argname="argument subnets", value=subnets, expected_type=type_hints["subnets"])
5638
+ check_type(argname="argument vpn_gateway_id", value=vpn_gateway_id, expected_type=type_hints["vpn_gateway_id"])
5639
+ self._values: typing.Dict[builtins.str, typing.Any] = {
5640
+ "vpc_cidr_block": vpc_cidr_block,
5641
+ "vpc_id": vpc_id,
5642
+ }
5643
+ if owner_account_id is not None:
5644
+ self._values["owner_account_id"] = owner_account_id
5645
+ if region is not None:
5646
+ self._values["region"] = region
5647
+ if secondary_cidr_blocks is not None:
5648
+ self._values["secondary_cidr_blocks"] = secondary_cidr_blocks
5649
+ if subnets is not None:
5650
+ self._values["subnets"] = subnets
5651
+ if vpn_gateway_id is not None:
5652
+ self._values["vpn_gateway_id"] = vpn_gateway_id
5653
+
5654
+ @builtins.property
5655
+ def vpc_cidr_block(self) -> builtins.str:
5656
+ '''(experimental) Primary VPC CIDR Block of the imported VPC Can only be IPv4.
5657
+
5658
+ :stability: experimental
5659
+ '''
5660
+ result = self._values.get("vpc_cidr_block")
5661
+ assert result is not None, "Required property 'vpc_cidr_block' is missing"
5662
+ return typing.cast(builtins.str, result)
5663
+
5664
+ @builtins.property
5665
+ def vpc_id(self) -> builtins.str:
5666
+ '''(experimental) The VPC ID Refers to physical Id of the resource.
5667
+
5668
+ :stability: experimental
5669
+ '''
5670
+ result = self._values.get("vpc_id")
5671
+ assert result is not None, "Required property 'vpc_id' is missing"
5672
+ return typing.cast(builtins.str, result)
5673
+
5674
+ @builtins.property
5675
+ def owner_account_id(self) -> typing.Optional[builtins.str]:
5676
+ '''(experimental) The ID of the AWS account that owns the imported VPC required in case of cross account VPC as given value will be used to set field account for imported VPC, which then later can be used for establishing VPC peering connection.
5677
+
5678
+ :default: - constructed with stack account value
5679
+
5680
+ :stability: experimental
5681
+ '''
5682
+ result = self._values.get("owner_account_id")
5683
+ return typing.cast(typing.Optional[builtins.str], result)
5684
+
5685
+ @builtins.property
5686
+ def region(self) -> typing.Optional[builtins.str]:
5687
+ '''(experimental) Region in which imported VPC is hosted required in case of cross region VPC as given value will be used to set field region for imported VPC, which then later can be used for establishing VPC peering connection.
5688
+
5689
+ :default: - constructed with stack region value
5690
+
5691
+ :stability: experimental
5692
+ '''
5693
+ result = self._values.get("region")
5694
+ return typing.cast(typing.Optional[builtins.str], result)
5695
+
5696
+ @builtins.property
5697
+ def secondary_cidr_blocks(
5698
+ self,
5699
+ ) -> typing.Optional[typing.List[VPCCidrBlockattributes]]:
5700
+ '''(experimental) Import Secondary CIDR blocks associated with VPC.
5701
+
5702
+ :default: - No secondary IP address
5703
+
5704
+ :stability: experimental
5705
+ '''
5706
+ result = self._values.get("secondary_cidr_blocks")
5707
+ return typing.cast(typing.Optional[typing.List[VPCCidrBlockattributes]], result)
5708
+
5709
+ @builtins.property
5710
+ def subnets(self) -> typing.Optional[typing.List[SubnetV2Attributes]]:
5711
+ '''(experimental) Subnets associated with imported VPC.
5712
+
5713
+ :default: - no subnets provided to be imported
5714
+
5715
+ :stability: experimental
5716
+ '''
5717
+ result = self._values.get("subnets")
5718
+ return typing.cast(typing.Optional[typing.List[SubnetV2Attributes]], result)
5719
+
5720
+ @builtins.property
5721
+ def vpn_gateway_id(self) -> typing.Optional[builtins.str]:
5722
+ '''(experimental) A VPN Gateway is attached to the VPC.
5723
+
5724
+ :default: - No VPN Gateway
5725
+
5726
+ :stability: experimental
5727
+ '''
5728
+ result = self._values.get("vpn_gateway_id")
5729
+ return typing.cast(typing.Optional[builtins.str], result)
5730
+
5731
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
5732
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
5733
+
5734
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
5735
+ return not (rhs == self)
5736
+
5737
+ def __repr__(self) -> str:
5738
+ return "VpcV2Attributes(%s)" % ", ".join(
5739
+ k + "=" + repr(v) for k, v in self._values.items()
5740
+ )
5741
+
5742
+
4868
5743
  @jsii.implements(IVpcV2)
4869
5744
  class VpcV2Base(
4870
5745
  _aws_cdk_ceddda9d.Resource,
@@ -5361,6 +6236,16 @@ class VpcV2Base(
5361
6236
  '''
5362
6237
  ...
5363
6238
 
6239
+ @builtins.property
6240
+ @jsii.member(jsii_name="ownerAccountId")
6241
+ @abc.abstractmethod
6242
+ def owner_account_id(self) -> builtins.str:
6243
+ '''(experimental) Identifier of the owner for this VPC.
6244
+
6245
+ :stability: experimental
6246
+ '''
6247
+ ...
6248
+
5364
6249
  @builtins.property
5365
6250
  @jsii.member(jsii_name="privateSubnets")
5366
6251
  def private_subnets(self) -> typing.List[_aws_cdk_aws_ec2_ceddda9d.ISubnet]:
@@ -5380,12 +6265,10 @@ class VpcV2Base(
5380
6265
  return typing.cast(typing.List[_aws_cdk_aws_ec2_ceddda9d.ISubnet], jsii.get(self, "publicSubnets"))
5381
6266
 
5382
6267
  @builtins.property
5383
- @jsii.member(jsii_name="secondaryCidrBlock")
6268
+ @jsii.member(jsii_name="region")
5384
6269
  @abc.abstractmethod
5385
- def secondary_cidr_block(
5386
- self,
5387
- ) -> typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock]:
5388
- '''(experimental) Secondary IPs for the VPC, can be multiple Ipv4 or Ipv6 Ipv4 should be within RFC#1918 range.
6270
+ def region(self) -> builtins.str:
6271
+ '''(experimental) Region for this VPC.
5389
6272
 
5390
6273
  :stability: experimental
5391
6274
  '''
@@ -5430,6 +6313,26 @@ class VpcV2Base(
5430
6313
  '''
5431
6314
  return typing.cast(typing.Optional[builtins.str], jsii.get(self, "internetGatewayId"))
5432
6315
 
6316
+ @builtins.property
6317
+ @jsii.member(jsii_name="ipv4IpamProvisionedCidrs")
6318
+ @abc.abstractmethod
6319
+ def ipv4_ipam_provisioned_cidrs(self) -> typing.Optional[typing.List[builtins.str]]:
6320
+ '''(experimental) IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool.
6321
+
6322
+ :stability: experimental
6323
+ '''
6324
+ ...
6325
+
6326
+ @builtins.property
6327
+ @jsii.member(jsii_name="secondaryCidrBlock")
6328
+ @abc.abstractmethod
6329
+ def secondary_cidr_block(self) -> typing.Optional[typing.List[IVPCCidrBlock]]:
6330
+ '''(experimental) Secondary IPs for the VPC, can be multiple Ipv4 or Ipv6 Ipv4 should be within RFC#1918 range.
6331
+
6332
+ :stability: experimental
6333
+ '''
6334
+ ...
6335
+
5433
6336
  @builtins.property
5434
6337
  @jsii.member(jsii_name="vpnGatewayId")
5435
6338
  def vpn_gateway_id(self) -> typing.Optional[builtins.str]:
@@ -5492,15 +6395,22 @@ class _VpcV2BaseProxy(
5492
6395
  return typing.cast(typing.List[_aws_cdk_aws_ec2_ceddda9d.ISubnet], jsii.get(self, "isolatedSubnets"))
5493
6396
 
5494
6397
  @builtins.property
5495
- @jsii.member(jsii_name="secondaryCidrBlock")
5496
- def secondary_cidr_block(
5497
- self,
5498
- ) -> typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock]:
5499
- '''(experimental) Secondary IPs for the VPC, can be multiple Ipv4 or Ipv6 Ipv4 should be within RFC#1918 range.
6398
+ @jsii.member(jsii_name="ownerAccountId")
6399
+ def owner_account_id(self) -> builtins.str:
6400
+ '''(experimental) Identifier of the owner for this VPC.
6401
+
6402
+ :stability: experimental
6403
+ '''
6404
+ return typing.cast(builtins.str, jsii.get(self, "ownerAccountId"))
6405
+
6406
+ @builtins.property
6407
+ @jsii.member(jsii_name="region")
6408
+ def region(self) -> builtins.str:
6409
+ '''(experimental) Region for this VPC.
5500
6410
 
5501
6411
  :stability: experimental
5502
6412
  '''
5503
- return typing.cast(typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock], jsii.get(self, "secondaryCidrBlock"))
6413
+ return typing.cast(builtins.str, jsii.get(self, "region"))
5504
6414
 
5505
6415
  @builtins.property
5506
6416
  @jsii.member(jsii_name="vpcArn")
@@ -5529,6 +6439,24 @@ class _VpcV2BaseProxy(
5529
6439
  '''
5530
6440
  return typing.cast(builtins.str, jsii.get(self, "vpcId"))
5531
6441
 
6442
+ @builtins.property
6443
+ @jsii.member(jsii_name="ipv4IpamProvisionedCidrs")
6444
+ def ipv4_ipam_provisioned_cidrs(self) -> typing.Optional[typing.List[builtins.str]]:
6445
+ '''(experimental) IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool.
6446
+
6447
+ :stability: experimental
6448
+ '''
6449
+ return typing.cast(typing.Optional[typing.List[builtins.str]], jsii.get(self, "ipv4IpamProvisionedCidrs"))
6450
+
6451
+ @builtins.property
6452
+ @jsii.member(jsii_name="secondaryCidrBlock")
6453
+ def secondary_cidr_block(self) -> typing.Optional[typing.List[IVPCCidrBlock]]:
6454
+ '''(experimental) Secondary IPs for the VPC, can be multiple Ipv4 or Ipv6 Ipv4 should be within RFC#1918 range.
6455
+
6456
+ :stability: experimental
6457
+ '''
6458
+ return typing.cast(typing.Optional[typing.List[IVPCCidrBlock]], jsii.get(self, "secondaryCidrBlock"))
6459
+
5532
6460
  # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class
5533
6461
  typing.cast(typing.Any, VpcV2Base).__jsii_proxy_class__ = lambda : _VpcV2BaseProxy
5534
6462
 
@@ -5861,6 +6789,51 @@ class VpcV2(
5861
6789
 
5862
6790
  jsii.create(self.__class__, self, [scope, id, props])
5863
6791
 
6792
+ @jsii.member(jsii_name="fromVpcV2Attributes")
6793
+ @builtins.classmethod
6794
+ def from_vpc_v2_attributes(
6795
+ cls,
6796
+ scope: _constructs_77d1e7e8.Construct,
6797
+ id: builtins.str,
6798
+ *,
6799
+ vpc_cidr_block: builtins.str,
6800
+ vpc_id: builtins.str,
6801
+ owner_account_id: typing.Optional[builtins.str] = None,
6802
+ region: typing.Optional[builtins.str] = None,
6803
+ secondary_cidr_blocks: typing.Optional[typing.Sequence[typing.Union[VPCCidrBlockattributes, typing.Dict[builtins.str, typing.Any]]]] = None,
6804
+ subnets: typing.Optional[typing.Sequence[typing.Union[SubnetV2Attributes, typing.Dict[builtins.str, typing.Any]]]] = None,
6805
+ vpn_gateway_id: typing.Optional[builtins.str] = None,
6806
+ ) -> IVpcV2:
6807
+ '''(experimental) Create a VPC from existing attributes.
6808
+
6809
+ :param scope: -
6810
+ :param id: -
6811
+ :param vpc_cidr_block: (experimental) Primary VPC CIDR Block of the imported VPC Can only be IPv4.
6812
+ :param vpc_id: (experimental) The VPC ID Refers to physical Id of the resource.
6813
+ :param owner_account_id: (experimental) The ID of the AWS account that owns the imported VPC required in case of cross account VPC as given value will be used to set field account for imported VPC, which then later can be used for establishing VPC peering connection. Default: - constructed with stack account value
6814
+ :param region: (experimental) Region in which imported VPC is hosted required in case of cross region VPC as given value will be used to set field region for imported VPC, which then later can be used for establishing VPC peering connection. Default: - constructed with stack region value
6815
+ :param secondary_cidr_blocks: (experimental) Import Secondary CIDR blocks associated with VPC. Default: - No secondary IP address
6816
+ :param subnets: (experimental) Subnets associated with imported VPC. Default: - no subnets provided to be imported
6817
+ :param vpn_gateway_id: (experimental) A VPN Gateway is attached to the VPC. Default: - No VPN Gateway
6818
+
6819
+ :stability: experimental
6820
+ '''
6821
+ if __debug__:
6822
+ type_hints = typing.get_type_hints(_typecheckingstub__a44e5d77c989876de48b8f71adf0b240f0b6a3149cc8bd0c5ab7bb8df6f6791f)
6823
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
6824
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
6825
+ attrs = VpcV2Attributes(
6826
+ vpc_cidr_block=vpc_cidr_block,
6827
+ vpc_id=vpc_id,
6828
+ owner_account_id=owner_account_id,
6829
+ region=region,
6830
+ secondary_cidr_blocks=secondary_cidr_blocks,
6831
+ subnets=subnets,
6832
+ vpn_gateway_id=vpn_gateway_id,
6833
+ )
6834
+
6835
+ return typing.cast(IVpcV2, jsii.sinvoke(cls, "fromVpcV2Attributes", [scope, id, attrs]))
6836
+
5864
6837
  @builtins.property
5865
6838
  @jsii.member(jsii_name="dnsHostnamesEnabled")
5866
6839
  def dns_hostnames_enabled(self) -> builtins.bool:
@@ -5930,6 +6903,15 @@ class VpcV2(
5930
6903
  '''
5931
6904
  return typing.cast(typing.List[_aws_cdk_aws_ec2_ceddda9d.ISubnet], jsii.get(self, "isolatedSubnets"))
5932
6905
 
6906
+ @builtins.property
6907
+ @jsii.member(jsii_name="ownerAccountId")
6908
+ def owner_account_id(self) -> builtins.str:
6909
+ '''(experimental) Identifier of the owner for this VPC.
6910
+
6911
+ :stability: experimental
6912
+ '''
6913
+ return typing.cast(builtins.str, jsii.get(self, "ownerAccountId"))
6914
+
5933
6915
  @builtins.property
5934
6916
  @jsii.member(jsii_name="privateSubnets")
5935
6917
  def private_subnets(self) -> typing.List[_aws_cdk_aws_ec2_ceddda9d.ISubnet]:
@@ -5949,24 +6931,22 @@ class VpcV2(
5949
6931
  return typing.cast(typing.List[_aws_cdk_aws_ec2_ceddda9d.ISubnet], jsii.get(self, "publicSubnets"))
5950
6932
 
5951
6933
  @builtins.property
5952
- @jsii.member(jsii_name="resource")
5953
- def resource(self) -> _aws_cdk_aws_ec2_ceddda9d.CfnVPC:
5954
- '''(experimental) The AWS CloudFormation resource representing the VPC.
6934
+ @jsii.member(jsii_name="region")
6935
+ def region(self) -> builtins.str:
6936
+ '''(experimental) Region for this VPC.
5955
6937
 
5956
6938
  :stability: experimental
5957
6939
  '''
5958
- return typing.cast(_aws_cdk_aws_ec2_ceddda9d.CfnVPC, jsii.get(self, "resource"))
6940
+ return typing.cast(builtins.str, jsii.get(self, "region"))
5959
6941
 
5960
6942
  @builtins.property
5961
- @jsii.member(jsii_name="secondaryCidrBlock")
5962
- def secondary_cidr_block(
5963
- self,
5964
- ) -> typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock]:
5965
- '''(experimental) reference to all secondary blocks attached.
6943
+ @jsii.member(jsii_name="resource")
6944
+ def resource(self) -> _aws_cdk_aws_ec2_ceddda9d.CfnVPC:
6945
+ '''(experimental) The AWS CloudFormation resource representing the VPC.
5966
6946
 
5967
6947
  :stability: experimental
5968
6948
  '''
5969
- return typing.cast(typing.List[_aws_cdk_aws_ec2_ceddda9d.CfnVPCCidrBlock], jsii.get(self, "secondaryCidrBlock"))
6949
+ return typing.cast(_aws_cdk_aws_ec2_ceddda9d.CfnVPC, jsii.get(self, "resource"))
5970
6950
 
5971
6951
  @builtins.property
5972
6952
  @jsii.member(jsii_name="useIpv6")
@@ -6008,6 +6988,24 @@ class VpcV2(
6008
6988
  '''
6009
6989
  return typing.cast(builtins.str, jsii.get(self, "vpcId"))
6010
6990
 
6991
+ @builtins.property
6992
+ @jsii.member(jsii_name="ipv4IpamProvisionedCidrs")
6993
+ def ipv4_ipam_provisioned_cidrs(self) -> typing.Optional[typing.List[builtins.str]]:
6994
+ '''(experimental) IPv4 CIDR provisioned using IPAM pool Required to check for overlapping CIDRs after provisioning is complete under IPAM.
6995
+
6996
+ :stability: experimental
6997
+ '''
6998
+ return typing.cast(typing.Optional[typing.List[builtins.str]], jsii.get(self, "ipv4IpamProvisionedCidrs"))
6999
+
7000
+ @builtins.property
7001
+ @jsii.member(jsii_name="secondaryCidrBlock")
7002
+ def secondary_cidr_block(self) -> typing.Optional[typing.List[IVPCCidrBlock]]:
7003
+ '''(experimental) reference to all secondary blocks attached.
7004
+
7005
+ :stability: experimental
7006
+ '''
7007
+ return typing.cast(typing.Optional[typing.List[IVPCCidrBlock]], jsii.get(self, "secondaryCidrBlock"))
7008
+
6011
7009
 
6012
7010
  __all__ = [
6013
7011
  "AddressFamily",
@@ -6021,6 +7019,7 @@ __all__ = [
6021
7019
  "IRouteTarget",
6022
7020
  "IRouteV2",
6023
7021
  "ISubnetV2",
7022
+ "IVPCCidrBlock",
6024
7023
  "IVpcV2",
6025
7024
  "InternetGateway",
6026
7025
  "InternetGatewayOptions",
@@ -6047,12 +7046,15 @@ __all__ = [
6047
7046
  "RouteTargetType",
6048
7047
  "SecondaryAddressProps",
6049
7048
  "SubnetV2",
7049
+ "SubnetV2Attributes",
6050
7050
  "SubnetV2Props",
7051
+ "VPCCidrBlockattributes",
6051
7052
  "VPNGatewayV2",
6052
7053
  "VPNGatewayV2Options",
6053
7054
  "VPNGatewayV2Props",
6054
7055
  "VpcCidrOptions",
6055
7056
  "VpcV2",
7057
+ "VpcV2Attributes",
6056
7058
  "VpcV2Base",
6057
7059
  "VpcV2Props",
6058
7060
  ]
@@ -6326,6 +7328,21 @@ def _typecheckingstub__df9294d0dd8fd099bad5e4bd408f0f8b8bffbcdc6e4f624de6a1bf541
6326
7328
  """Type checking stubs"""
6327
7329
  pass
6328
7330
 
7331
+ def _typecheckingstub__4b7efcb4a40a1cd4c8f364f2028af9d8a2b5e24d65cf7122742bca15d44a40ae(
7332
+ scope: _constructs_77d1e7e8.Construct,
7333
+ id: builtins.str,
7334
+ *,
7335
+ availability_zone: builtins.str,
7336
+ ipv4_cidr_block: builtins.str,
7337
+ subnet_id: builtins.str,
7338
+ subnet_type: _aws_cdk_aws_ec2_ceddda9d.SubnetType,
7339
+ ipv6_cidr_block: typing.Optional[builtins.str] = None,
7340
+ route_table_id: typing.Optional[builtins.str] = None,
7341
+ subnet_name: typing.Optional[builtins.str] = None,
7342
+ ) -> None:
7343
+ """Type checking stubs"""
7344
+ pass
7345
+
6329
7346
  def _typecheckingstub__c5ecedf09cdae417f7675efd5f583cb5bfabde2a1b69f4f330c6434c1020e903(
6330
7347
  id: builtins.str,
6331
7348
  network_acl: _aws_cdk_aws_ec2_ceddda9d.INetworkAcl,
@@ -6333,6 +7350,19 @@ def _typecheckingstub__c5ecedf09cdae417f7675efd5f583cb5bfabde2a1b69f4f330c6434c1
6333
7350
  """Type checking stubs"""
6334
7351
  pass
6335
7352
 
7353
+ def _typecheckingstub__d1c1c485159a040f312fb9bac0ed6195b5a11d0519ac42081997619b64a0858c(
7354
+ *,
7355
+ availability_zone: builtins.str,
7356
+ ipv4_cidr_block: builtins.str,
7357
+ subnet_id: builtins.str,
7358
+ subnet_type: _aws_cdk_aws_ec2_ceddda9d.SubnetType,
7359
+ ipv6_cidr_block: typing.Optional[builtins.str] = None,
7360
+ route_table_id: typing.Optional[builtins.str] = None,
7361
+ subnet_name: typing.Optional[builtins.str] = None,
7362
+ ) -> None:
7363
+ """Type checking stubs"""
7364
+ pass
7365
+
6336
7366
  def _typecheckingstub__95ce99f8025433ac8b79825abef6ff91da4dfd0693fd24dadedcee63eb93d668(
6337
7367
  *,
6338
7368
  availability_zone: builtins.str,
@@ -6347,6 +7377,20 @@ def _typecheckingstub__95ce99f8025433ac8b79825abef6ff91da4dfd0693fd24dadedcee63e
6347
7377
  """Type checking stubs"""
6348
7378
  pass
6349
7379
 
7380
+ def _typecheckingstub__4302f03d1c3aa687fb9a6d3011f239c94d844badf36d9d2e8270a543f80a5d49(
7381
+ *,
7382
+ amazon_provided_ipv6_cidr_block: typing.Optional[builtins.bool] = None,
7383
+ cidr_block: typing.Optional[builtins.str] = None,
7384
+ cidr_block_name: typing.Optional[builtins.str] = None,
7385
+ ipv4_ipam_pool_id: typing.Optional[builtins.str] = None,
7386
+ ipv4_ipam_provisioned_cidrs: typing.Optional[typing.Sequence[builtins.str]] = None,
7387
+ ipv4_netmask_length: typing.Optional[jsii.Number] = None,
7388
+ ipv6_ipam_pool_id: typing.Optional[builtins.str] = None,
7389
+ ipv6_netmask_length: typing.Optional[jsii.Number] = None,
7390
+ ) -> None:
7391
+ """Type checking stubs"""
7392
+ pass
7393
+
6350
7394
  def _typecheckingstub__99ebb03388deee94929850a6302ea70455c70b08fdbc048c0ad431df4f5d7bff(
6351
7395
  scope: _constructs_77d1e7e8.Construct,
6352
7396
  id: builtins.str,
@@ -6388,6 +7432,7 @@ def _typecheckingstub__dc5a774224468f268ba34d837f3aec361583306c8694ae77cdb19bb4c
6388
7432
  dependencies: typing.Optional[typing.Sequence[_aws_cdk_ceddda9d.CfnResource]] = None,
6389
7433
  ipv4_cidr_block: typing.Optional[builtins.str] = None,
6390
7434
  ipv4_ipam_pool: typing.Optional[IIpamPool] = None,
7435
+ ipv4_ipam_provisioned_cidrs: typing.Optional[typing.Sequence[builtins.str]] = None,
6391
7436
  ipv4_netmask_length: typing.Optional[jsii.Number] = None,
6392
7437
  ipv6_ipam_pool: typing.Optional[IIpamPool] = None,
6393
7438
  ipv6_netmask_length: typing.Optional[jsii.Number] = None,
@@ -6395,6 +7440,19 @@ def _typecheckingstub__dc5a774224468f268ba34d837f3aec361583306c8694ae77cdb19bb4c
6395
7440
  """Type checking stubs"""
6396
7441
  pass
6397
7442
 
7443
+ def _typecheckingstub__456e1aed5fd7b92e9fe1ffc4615970b62870dbb14e689177f2fdb104f3200b6b(
7444
+ *,
7445
+ vpc_cidr_block: builtins.str,
7446
+ vpc_id: builtins.str,
7447
+ owner_account_id: typing.Optional[builtins.str] = None,
7448
+ region: typing.Optional[builtins.str] = None,
7449
+ secondary_cidr_blocks: typing.Optional[typing.Sequence[typing.Union[VPCCidrBlockattributes, typing.Dict[builtins.str, typing.Any]]]] = None,
7450
+ subnets: typing.Optional[typing.Sequence[typing.Union[SubnetV2Attributes, typing.Dict[builtins.str, typing.Any]]]] = None,
7451
+ vpn_gateway_id: typing.Optional[builtins.str] = None,
7452
+ ) -> None:
7453
+ """Type checking stubs"""
7454
+ pass
7455
+
6398
7456
  def _typecheckingstub__ff6eb90e3be796c2f978cd0f80c5571eb321f8dc6456107e14e0363d3dd777fb(
6399
7457
  scope: _constructs_77d1e7e8.Construct,
6400
7458
  id: builtins.str,
@@ -6518,3 +7576,18 @@ def _typecheckingstub__43890f4b3ccf690abe4140abf07c3436fde6604bac35ff6b2e8fe5da2
6518
7576
  ) -> None:
6519
7577
  """Type checking stubs"""
6520
7578
  pass
7579
+
7580
+ def _typecheckingstub__a44e5d77c989876de48b8f71adf0b240f0b6a3149cc8bd0c5ab7bb8df6f6791f(
7581
+ scope: _constructs_77d1e7e8.Construct,
7582
+ id: builtins.str,
7583
+ *,
7584
+ vpc_cidr_block: builtins.str,
7585
+ vpc_id: builtins.str,
7586
+ owner_account_id: typing.Optional[builtins.str] = None,
7587
+ region: typing.Optional[builtins.str] = None,
7588
+ secondary_cidr_blocks: typing.Optional[typing.Sequence[typing.Union[VPCCidrBlockattributes, typing.Dict[builtins.str, typing.Any]]]] = None,
7589
+ subnets: typing.Optional[typing.Sequence[typing.Union[SubnetV2Attributes, typing.Dict[builtins.str, typing.Any]]]] = None,
7590
+ vpn_gateway_id: typing.Optional[builtins.str] = None,
7591
+ ) -> None:
7592
+ """Type checking stubs"""
7593
+ pass