File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
packages/aws-cdk-lib/aws-ec2/lib Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -1527,10 +1527,6 @@ export class Vpc extends VpcBase {
1527
1527
const ipProtocol = props . ipProtocol ?? IpProtocol . IPV4_ONLY ;
1528
1528
// this property can be set to false if an IPv6_ONLY VPC is implemented in the future
1529
1529
this . useIpv4 = ipProtocol === IpProtocol . IPV4_ONLY || ipProtocol === IpProtocol . DUAL_STACK ;
1530
- // use property to avoid lint errors
1531
- if ( this . useIpv4 ) {
1532
- ; // pass
1533
- }
1534
1530
1535
1531
this . useIpv6 = ipProtocol === IpProtocol . DUAL_STACK ;
1536
1532
@@ -1639,8 +1635,10 @@ export class Vpc extends VpcBase {
1639
1635
} ) ;
1640
1636
1641
1637
( this . publicSubnets as PublicSubnet [ ] ) . forEach ( publicSubnet => {
1642
- publicSubnet . addDefaultInternetRoute ( igw . ref , att ) ;
1643
-
1638
+ // configure IPv4 route
1639
+ if ( this . useIpv4 ) {
1640
+ publicSubnet . addDefaultInternetRoute ( igw . ref , att ) ;
1641
+ }
1644
1642
// configure IPv6 route if VPC is dual stack
1645
1643
if ( this . useIpv6 ) {
1646
1644
publicSubnet . addIpv6DefaultInternetRoute ( igw . ref ) ;
@@ -2213,6 +2211,11 @@ export class Subnet extends Resource implements ISubnet {
2213
2211
} ) ;
2214
2212
}
2215
2213
2214
+ /**
2215
+ * Adds an entry to this subnets route table that points to the passed NATGatewayId.
2216
+ * Uses the known 64:ff9b::/96 prefix.
2217
+ * @param natGatewayId The ID of the NAT gateway
2218
+ */
2216
2219
public addIpv6Nat64Route ( natGatewayId : string ) {
2217
2220
this . addRoute ( 'Nat64' , {
2218
2221
routerType : RouterType . NAT_GATEWAY ,
You can’t perform that action at this time.
0 commit comments