From e9c6e23ec49405c2f24b7a78ffb427dff6b72822 Mon Sep 17 00:00:00 2001 From: Kazuho Cryer-Shinozuka Date: Mon, 9 Dec 2024 23:06:17 +0900 Subject: [PATCH] fix(elasticloadbalancingv2): cannot create UDP listener for dual-stack NLB (#32184) ### Issue # (if applicable) None ### Reason for this change NetworkListener has the validation that it does not create UDP listeners for dual-stack NLB. However, dual-stack NLB now supports the creation of UDP listeners, and this validation is no longer required. ### Description of changes - Remove this validation from NetworkListener class. ```ts if ( props.loadBalancer.ipAddressType === IpAddressType.DUAL_STACK && (props.protocol === Protocol.UDP || props.protocol === Protocol.TCP_UDP) ) { throw new Error('UDP or TCP_UDP listeners cannot be added to a dualstack network load balancer.'); } ``` - Add `enablePrefixIpv6SourceNat` to the `NetworkLoadbalancerProps` - It is essential to enable this parameter for UDP listener with dual-stack NLB. - ref: https://github.com/aws/aws-cdk/pull/32184#issuecomment-2510536270 ### Description of how you validated changes Add both unit and integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- ...NlbEnablePrefixForIpv6NatStack.assets.json | 19 + ...bEnablePrefixForIpv6NatStack.template.json | 707 ++++++++++ ...efaultTestDeployAssert4C17D694.assets.json | 19 + ...aultTestDeployAssert4C17D694.template.json | 36 + .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 311 +++++ .../tree.json | 1134 +++++++++++++++++ .../integ.nlb-enable-prefix-for-ipv6-nat.ts | 73 ++ .../aws-elasticloadbalancingv2/README.md | 19 +- .../lib/nlb/network-listener.ts | 9 +- .../lib/nlb/network-load-balancer.ts | 22 +- .../test/nlb/load-balancer.test.ts | 47 +- 13 files changed, 2380 insertions(+), 29 deletions(-) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStack.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStack.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStack.assets.json new file mode 100644 index 0000000000000..34d0c4649041f --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStack.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "fa46958bcb246c27c21906c9bf41a44bce7f9613a3d90335588eedc4daeb49dd": { + "source": { + "path": "NlbEnablePrefixForIpv6NatStack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "fa46958bcb246c27c21906c9bf41a44bce7f9613a3d90335588eedc4daeb49dd.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStack.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStack.template.json new file mode 100644 index 0000000000000..a5031e0a2dafc --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStack.template.json @@ -0,0 +1,707 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "NlbEnablePrefixForIpv6NatStack/Vpc" + } + ] + } + }, + "Vpcipv6cidr40D3CB78": { + "Type": "AWS::EC2::VPCCidrBlock", + "Properties": { + "AmazonProvidedIpv6CidrBlock": true, + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet1Subnet5C2D37C4": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AssignIpv6AddressOnCreation": true, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "Ipv6CidrBlock": { + "Fn::Select": [ + 0, + { + "Fn::Cidr": [ + { + "Fn::Select": [ + 0, + { + "Fn::GetAtt": [ + "Vpc8378EB38", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcPublicSubnet1RouteTable6C95E38E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcPublicSubnet1RouteTableAssociation97140677": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcPublicSubnet1DefaultRoute3DA9E72A": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78", + "VpcVPCGWBF912B6E" + ] + }, + "VpcPublicSubnet1DefaultRoute6A21265FB": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationIpv6CidrBlock": "::/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcPublicSubnet2Subnet691E08A3": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AssignIpv6AddressOnCreation": true, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "Ipv6CidrBlock": { + "Fn::Select": [ + 1, + { + "Fn::Cidr": [ + { + "Fn::Select": [ + 0, + { + "Fn::GetAtt": [ + "Vpc8378EB38", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcPublicSubnet2RouteTable94F7E489": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcPublicSubnet2RouteTableAssociationDD5762D8": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcPublicSubnet2DefaultRoute97F91067": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78", + "VpcVPCGWBF912B6E" + ] + }, + "VpcPublicSubnet2DefaultRoute63E63096C": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationIpv6CidrBlock": "::/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcIsolatedSubnet1SubnetE48C5737": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AssignIpv6AddressOnCreation": true, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "Ipv6CidrBlock": { + "Fn::Select": [ + 2, + { + "Fn::Cidr": [ + { + "Fn::Select": [ + 0, + { + "Fn::GetAtt": [ + "Vpc8378EB38", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Isolated" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcIsolatedSubnet1RouteTable4771E3E5": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcIsolatedSubnet1RouteTableAssociationD300FCBB": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcIsolatedSubnet1RouteTable4771E3E5" + }, + "SubnetId": { + "Ref": "VpcIsolatedSubnet1SubnetE48C5737" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcIsolatedSubnet2Subnet16364B91": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AssignIpv6AddressOnCreation": true, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "Ipv6CidrBlock": { + "Fn::Select": [ + 3, + { + "Fn::Cidr": [ + { + "Fn::Select": [ + 0, + { + "Fn::GetAtt": [ + "Vpc8378EB38", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Isolated" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcIsolatedSubnet2RouteTable1D30AF7D": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcIsolatedSubnet2RouteTableAssociationF7B18CCA": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcIsolatedSubnet2RouteTable1D30AF7D" + }, + "SubnetId": { + "Ref": "VpcIsolatedSubnet2Subnet16364B91" + } + }, + "DependsOn": [ + "Vpcipv6cidr40D3CB78" + ] + }, + "VpcIGWD7BA715C": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbEnablePrefixForIpv6NatStack/Vpc" + } + ] + } + }, + "VpcVPCGWBF912B6E": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcEIGW61416F369": { + "Type": "AWS::EC2::EgressOnlyInternetGateway", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "DisabledLbSgB7154DC8": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "NlbEnablePrefixForIpv6NatStack/DisabledLbSg", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "DisabledLbF70482DB": { + "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", + "Properties": { + "EnablePrefixForIpv6SourceNat": "off", + "IpAddressType": "dualstack", + "LoadBalancerAttributes": [ + { + "Key": "deletion_protection.enabled", + "Value": "false" + } + ], + "Scheme": "internet-facing", + "SecurityGroups": [ + { + "Fn::GetAtt": [ + "DisabledLbSgB7154DC8", + "GroupId" + ] + } + ], + "Subnets": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ], + "Type": "network" + }, + "DependsOn": [ + "VpcPublicSubnet1DefaultRoute3DA9E72A", + "VpcPublicSubnet1DefaultRoute6A21265FB", + "VpcPublicSubnet1RouteTableAssociation97140677", + "VpcPublicSubnet2DefaultRoute97F91067", + "VpcPublicSubnet2DefaultRoute63E63096C", + "VpcPublicSubnet2RouteTableAssociationDD5762D8" + ] + }, + "DisabledLbTcpListener070B4D6E": { + "Type": "AWS::ElasticLoadBalancingV2::Listener", + "Properties": { + "DefaultActions": [ + { + "TargetGroupArn": { + "Ref": "TcpTargetGroupD98C5CDB" + }, + "Type": "forward" + } + ], + "LoadBalancerArn": { + "Ref": "DisabledLbF70482DB" + }, + "Port": 1229, + "Protocol": "TCP" + } + }, + "TcpTargetGroupD98C5CDB": { + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "Properties": { + "IpAddressType": "ipv6", + "Port": 1229, + "Protocol": "TCP", + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "EnabledLbSg11D53248": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "NlbEnablePrefixForIpv6NatStack/EnabledLbSg", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "EnabledLb9F3E8D30": { + "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", + "Properties": { + "EnablePrefixForIpv6SourceNat": "on", + "IpAddressType": "dualstack", + "LoadBalancerAttributes": [ + { + "Key": "deletion_protection.enabled", + "Value": "false" + } + ], + "Scheme": "internet-facing", + "SecurityGroups": [ + { + "Fn::GetAtt": [ + "EnabledLbSg11D53248", + "GroupId" + ] + } + ], + "Subnets": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ], + "Type": "network" + }, + "DependsOn": [ + "VpcPublicSubnet1DefaultRoute3DA9E72A", + "VpcPublicSubnet1DefaultRoute6A21265FB", + "VpcPublicSubnet1RouteTableAssociation97140677", + "VpcPublicSubnet2DefaultRoute97F91067", + "VpcPublicSubnet2DefaultRoute63E63096C", + "VpcPublicSubnet2RouteTableAssociationDD5762D8" + ] + }, + "EnabledLbUdpListener550E1122": { + "Type": "AWS::ElasticLoadBalancingV2::Listener", + "Properties": { + "DefaultActions": [ + { + "TargetGroupArn": { + "Ref": "UdpTargetGroup5F89FEC0" + }, + "Type": "forward" + } + ], + "LoadBalancerArn": { + "Ref": "EnabledLb9F3E8D30" + }, + "Port": 1229, + "Protocol": "UDP" + } + }, + "EnabledLbTcpWithUdpListenerBBFA335D": { + "Type": "AWS::ElasticLoadBalancingV2::Listener", + "Properties": { + "DefaultActions": [ + { + "TargetGroupArn": { + "Ref": "TcpWithUdpTargetGroup827EE6D7" + }, + "Type": "forward" + } + ], + "LoadBalancerArn": { + "Ref": "EnabledLb9F3E8D30" + }, + "Port": 3502, + "Protocol": "TCP_UDP" + } + }, + "UdpTargetGroup5F89FEC0": { + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "Properties": { + "IpAddressType": "ipv6", + "Port": 1229, + "Protocol": "UDP", + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "TcpWithUdpTargetGroup827EE6D7": { + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "Properties": { + "IpAddressType": "ipv6", + "Port": 3502, + "Protocol": "TCP_UDP", + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.assets.json new file mode 100644 index 0000000000000..a47c44feab324 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/cdk.out new file mode 100644 index 0000000000000..c6e612584e352 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/integ.json new file mode 100644 index 0000000000000..2512b45a69413 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "NlbEnablePrefixForIpv6NatStackTest/DefaultTest": { + "stacks": [ + "NlbEnablePrefixForIpv6NatStack" + ], + "assertionStack": "NlbEnablePrefixForIpv6NatStackTest/DefaultTest/DeployAssert", + "assertionStackName": "NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/manifest.json new file mode 100644 index 0000000000000..c9ae9e3d676a6 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/manifest.json @@ -0,0 +1,311 @@ +{ + "version": "38.0.1", + "artifacts": { + "NlbEnablePrefixForIpv6NatStack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "NlbEnablePrefixForIpv6NatStack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "NlbEnablePrefixForIpv6NatStack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "NlbEnablePrefixForIpv6NatStack.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fa46958bcb246c27c21906c9bf41a44bce7f9613a3d90335588eedc4daeb49dd.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "NlbEnablePrefixForIpv6NatStack.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "NlbEnablePrefixForIpv6NatStack.assets" + ], + "metadata": { + "/NlbEnablePrefixForIpv6NatStack/Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Vpc8378EB38" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/ipv6cidr": [ + { + "type": "aws:cdk:logicalId", + "data": "Vpcipv6cidr40D3CB78" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1Subnet5C2D37C4" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1RouteTable6C95E38E" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1RouteTableAssociation97140677" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1DefaultRoute3DA9E72A" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1/DefaultRoute6": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1DefaultRoute6A21265FB" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2Subnet691E08A3" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2RouteTable94F7E489" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2RouteTableAssociationDD5762D8" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2DefaultRoute97F91067" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2/DefaultRoute6": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2DefaultRoute63E63096C" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcIsolatedSubnet1SubnetE48C5737" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcIsolatedSubnet1RouteTable4771E3E5" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcIsolatedSubnet1RouteTableAssociationD300FCBB" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcIsolatedSubnet2Subnet16364B91" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcIsolatedSubnet2RouteTable1D30AF7D" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcIsolatedSubnet2RouteTableAssociationF7B18CCA" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcIGWD7BA715C" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcVPCGWBF912B6E" + } + ], + "/NlbEnablePrefixForIpv6NatStack/Vpc/EIGW6": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcEIGW61416F369" + } + ], + "/NlbEnablePrefixForIpv6NatStack/DisabledLbSg/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DisabledLbSgB7154DC8" + } + ], + "/NlbEnablePrefixForIpv6NatStack/DisabledLb/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DisabledLbF70482DB" + } + ], + "/NlbEnablePrefixForIpv6NatStack/DisabledLb/TcpListener/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DisabledLbTcpListener070B4D6E" + } + ], + "/NlbEnablePrefixForIpv6NatStack/TcpTargetGroup": [ + { + "type": "aws:cdk:warning", + "data": "When creating an empty TargetGroup, you should specify a 'targetType' (this warning may become an error in the future). [ack: @aws-cdk/aws-elbv2:targetGroupSpecifyTargetTypeForEmptyTargetGroup]" + } + ], + "/NlbEnablePrefixForIpv6NatStack/TcpTargetGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TcpTargetGroupD98C5CDB" + } + ], + "/NlbEnablePrefixForIpv6NatStack/EnabledLbSg/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "EnabledLbSg11D53248" + } + ], + "/NlbEnablePrefixForIpv6NatStack/EnabledLb/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "EnabledLb9F3E8D30" + } + ], + "/NlbEnablePrefixForIpv6NatStack/EnabledLb/UdpListener/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "EnabledLbUdpListener550E1122" + } + ], + "/NlbEnablePrefixForIpv6NatStack/EnabledLb/TcpWithUdpListener/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "EnabledLbTcpWithUdpListenerBBFA335D" + } + ], + "/NlbEnablePrefixForIpv6NatStack/UdpTargetGroup": [ + { + "type": "aws:cdk:warning", + "data": "When creating an empty TargetGroup, you should specify a 'targetType' (this warning may become an error in the future). [ack: @aws-cdk/aws-elbv2:targetGroupSpecifyTargetTypeForEmptyTargetGroup]" + } + ], + "/NlbEnablePrefixForIpv6NatStack/UdpTargetGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "UdpTargetGroup5F89FEC0" + } + ], + "/NlbEnablePrefixForIpv6NatStack/TcpWithUdpTargetGroup": [ + { + "type": "aws:cdk:warning", + "data": "When creating an empty TargetGroup, you should specify a 'targetType' (this warning may become an error in the future). [ack: @aws-cdk/aws-elbv2:targetGroupSpecifyTargetTypeForEmptyTargetGroup]" + } + ], + "/NlbEnablePrefixForIpv6NatStack/TcpWithUdpTargetGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "TcpWithUdpTargetGroup827EE6D7" + } + ], + "/NlbEnablePrefixForIpv6NatStack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/NlbEnablePrefixForIpv6NatStack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "NlbEnablePrefixForIpv6NatStack" + }, + "NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "NlbEnablePrefixForIpv6NatStackTestDefaultTestDeployAssert4C17D694.assets" + ], + "metadata": { + "/NlbEnablePrefixForIpv6NatStackTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/NlbEnablePrefixForIpv6NatStackTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "NlbEnablePrefixForIpv6NatStackTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/tree.json new file mode 100644 index 0000000000000..75cb2ae8bbbe6 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.js.snapshot/tree.json @@ -0,0 +1,1134 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "NlbEnablePrefixForIpv6NatStack": { + "id": "NlbEnablePrefixForIpv6NatStack", + "path": "NlbEnablePrefixForIpv6NatStack", + "children": { + "Vpc": { + "id": "Vpc", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "NlbEnablePrefixForIpv6NatStack/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "ipv6cidr": { + "id": "ipv6cidr", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/ipv6cidr", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCCidrBlock", + "aws:cdk:cloudformation:props": { + "amazonProvidedIpv6CidrBlock": true, + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "assignIpv6AddressOnCreation": true, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "ipv6CidrBlock": { + "Fn::Select": [ + 0, + { + "Fn::Cidr": [ + { + "Fn::Select": [ + 0, + { + "Fn::GetAtt": [ + "Vpc8378EB38", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + }, + "subnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "routeTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute6": { + "id": "DefaultRoute6", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet1/DefaultRoute6", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationIpv6CidrBlock": "::/0", + "gatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "routeTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "assignIpv6AddressOnCreation": true, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "ipv6CidrBlock": { + "Fn::Select": [ + 1, + { + "Fn::Cidr": [ + { + "Fn::Select": [ + 0, + { + "Fn::GetAtt": [ + "Vpc8378EB38", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + }, + "subnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "routeTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute6": { + "id": "DefaultRoute6", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/PublicSubnet2/DefaultRoute6", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationIpv6CidrBlock": "::/0", + "gatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "routeTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IsolatedSubnet1": { + "id": "IsolatedSubnet1", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "assignIpv6AddressOnCreation": true, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "ipv6CidrBlock": { + "Fn::Select": [ + 2, + { + "Fn::Cidr": [ + { + "Fn::Select": [ + 0, + { + "Fn::GetAtt": [ + "Vpc8378EB38", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Isolated" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcIsolatedSubnet1RouteTable4771E3E5" + }, + "subnetId": { + "Ref": "VpcIsolatedSubnet1SubnetE48C5737" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IsolatedSubnet2": { + "id": "IsolatedSubnet2", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "assignIpv6AddressOnCreation": true, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "ipv6CidrBlock": { + "Fn::Select": [ + 3, + { + "Fn::Cidr": [ + { + "Fn::Select": [ + 0, + { + "Fn::GetAtt": [ + "Vpc8378EB38", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Isolated" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/IsolatedSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcIsolatedSubnet2RouteTable1D30AF7D" + }, + "subnetId": { + "Ref": "VpcIsolatedSubnet2Subnet16364B91" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IGW": { + "id": "IGW", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbEnablePrefixForIpv6NatStack/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "EIGW6": { + "id": "EIGW6", + "path": "NlbEnablePrefixForIpv6NatStack/Vpc/EIGW6", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EgressOnlyInternetGateway", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DisabledLbSg": { + "id": "DisabledLbSg", + "path": "NlbEnablePrefixForIpv6NatStack/DisabledLbSg", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbEnablePrefixForIpv6NatStack/DisabledLbSg/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "NlbEnablePrefixForIpv6NatStack/DisabledLbSg", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DisabledLb": { + "id": "DisabledLb", + "path": "NlbEnablePrefixForIpv6NatStack/DisabledLb", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbEnablePrefixForIpv6NatStack/DisabledLb/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::LoadBalancer", + "aws:cdk:cloudformation:props": { + "enablePrefixForIpv6SourceNat": "off", + "ipAddressType": "dualstack", + "loadBalancerAttributes": [ + { + "key": "deletion_protection.enabled", + "value": "false" + } + ], + "scheme": "internet-facing", + "securityGroups": [ + { + "Fn::GetAtt": [ + "DisabledLbSgB7154DC8", + "GroupId" + ] + } + ], + "subnets": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ], + "type": "network" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "TcpListener": { + "id": "TcpListener", + "path": "NlbEnablePrefixForIpv6NatStack/DisabledLb/TcpListener", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbEnablePrefixForIpv6NatStack/DisabledLb/TcpListener/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::Listener", + "aws:cdk:cloudformation:props": { + "defaultActions": [ + { + "type": "forward", + "targetGroupArn": { + "Ref": "TcpTargetGroupD98C5CDB" + } + } + ], + "loadBalancerArn": { + "Ref": "DisabledLbF70482DB" + }, + "port": 1229, + "protocol": "TCP" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "TcpTargetGroup": { + "id": "TcpTargetGroup", + "path": "NlbEnablePrefixForIpv6NatStack/TcpTargetGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbEnablePrefixForIpv6NatStack/TcpTargetGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "aws:cdk:cloudformation:props": { + "ipAddressType": "ipv6", + "port": 1229, + "protocol": "TCP", + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "EnabledLbSg": { + "id": "EnabledLbSg", + "path": "NlbEnablePrefixForIpv6NatStack/EnabledLbSg", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbEnablePrefixForIpv6NatStack/EnabledLbSg/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "NlbEnablePrefixForIpv6NatStack/EnabledLbSg", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "EnabledLb": { + "id": "EnabledLb", + "path": "NlbEnablePrefixForIpv6NatStack/EnabledLb", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbEnablePrefixForIpv6NatStack/EnabledLb/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::LoadBalancer", + "aws:cdk:cloudformation:props": { + "enablePrefixForIpv6SourceNat": "on", + "ipAddressType": "dualstack", + "loadBalancerAttributes": [ + { + "key": "deletion_protection.enabled", + "value": "false" + } + ], + "scheme": "internet-facing", + "securityGroups": [ + { + "Fn::GetAtt": [ + "EnabledLbSg11D53248", + "GroupId" + ] + } + ], + "subnets": [ + { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + ], + "type": "network" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "UdpListener": { + "id": "UdpListener", + "path": "NlbEnablePrefixForIpv6NatStack/EnabledLb/UdpListener", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbEnablePrefixForIpv6NatStack/EnabledLb/UdpListener/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::Listener", + "aws:cdk:cloudformation:props": { + "defaultActions": [ + { + "type": "forward", + "targetGroupArn": { + "Ref": "UdpTargetGroup5F89FEC0" + } + } + ], + "loadBalancerArn": { + "Ref": "EnabledLb9F3E8D30" + }, + "port": 1229, + "protocol": "UDP" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "TcpWithUdpListener": { + "id": "TcpWithUdpListener", + "path": "NlbEnablePrefixForIpv6NatStack/EnabledLb/TcpWithUdpListener", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbEnablePrefixForIpv6NatStack/EnabledLb/TcpWithUdpListener/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::Listener", + "aws:cdk:cloudformation:props": { + "defaultActions": [ + { + "type": "forward", + "targetGroupArn": { + "Ref": "TcpWithUdpTargetGroup827EE6D7" + } + } + ], + "loadBalancerArn": { + "Ref": "EnabledLb9F3E8D30" + }, + "port": 3502, + "protocol": "TCP_UDP" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "UdpTargetGroup": { + "id": "UdpTargetGroup", + "path": "NlbEnablePrefixForIpv6NatStack/UdpTargetGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbEnablePrefixForIpv6NatStack/UdpTargetGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "aws:cdk:cloudformation:props": { + "ipAddressType": "ipv6", + "port": 1229, + "protocol": "UDP", + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "TcpWithUdpTargetGroup": { + "id": "TcpWithUdpTargetGroup", + "path": "NlbEnablePrefixForIpv6NatStack/TcpWithUdpTargetGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbEnablePrefixForIpv6NatStack/TcpWithUdpTargetGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "aws:cdk:cloudformation:props": { + "ipAddressType": "ipv6", + "port": 3502, + "protocol": "TCP_UDP", + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "NlbEnablePrefixForIpv6NatStack/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "NlbEnablePrefixForIpv6NatStack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "NlbEnablePrefixForIpv6NatStackTest": { + "id": "NlbEnablePrefixForIpv6NatStackTest", + "path": "NlbEnablePrefixForIpv6NatStackTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "NlbEnablePrefixForIpv6NatStackTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "NlbEnablePrefixForIpv6NatStackTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "NlbEnablePrefixForIpv6NatStackTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "NlbEnablePrefixForIpv6NatStackTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "NlbEnablePrefixForIpv6NatStackTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.ts new file mode 100644 index 0000000000000..f33dcb18f61b5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-enable-prefix-for-ipv6-nat.ts @@ -0,0 +1,73 @@ +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import * as cdk from 'aws-cdk-lib'; +import * as integ from '@aws-cdk/integ-tests-alpha'; +import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2'; + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'NlbEnablePrefixForIpv6NatStack'); + +const vpc = new ec2.Vpc(stack, 'Vpc', { + restrictDefaultSecurityGroup: false, + maxAzs: 2, + ipProtocol: ec2.IpProtocol.DUAL_STACK, + natGateways: 0, +}); + +const disabledNlb = new elbv2.NetworkLoadBalancer(stack, 'DisabledLb', { + vpc, + internetFacing: true, + securityGroups: [ + new ec2.SecurityGroup(stack, 'DisabledLbSg', { vpc }), + ], + enablePrefixForIpv6SourceNat: false, + ipAddressType: elbv2.IpAddressType.DUAL_STACK, +}); + +const tcpListener = disabledNlb.addListener('TcpListener', { + port: 1229, + protocol: elbv2.Protocol.TCP, +}); +const tcpTargetGroup = new elbv2.NetworkTargetGroup(stack, 'TcpTargetGroup', { + vpc, + port: 1229, + protocol: elbv2.Protocol.TCP, + ipAddressType: elbv2.TargetGroupIpAddressType.IPV6, +}); +tcpListener.addTargetGroups('TcpTargetGroup', tcpTargetGroup); + +const enabledNlb = new elbv2.NetworkLoadBalancer(stack, 'EnabledLb', { + vpc, + internetFacing: true, + securityGroups: [ + new ec2.SecurityGroup(stack, 'EnabledLbSg', { vpc }), + ], + ipAddressType: elbv2.IpAddressType.DUAL_STACK, + enablePrefixForIpv6SourceNat: true, +}); +const udpListener = enabledNlb.addListener('UdpListener', { + port: 1229, + protocol: elbv2.Protocol.UDP, +}); +const udpTargetGroup = new elbv2.NetworkTargetGroup(stack, 'UdpTargetGroup', { + vpc, + port: 1229, + protocol: elbv2.Protocol.UDP, + ipAddressType: elbv2.TargetGroupIpAddressType.IPV6, +}); +udpListener.addTargetGroups('TargetGroup', udpTargetGroup); + +const tcpWithUdpListener = enabledNlb.addListener('TcpWithUdpListener', { + port: 3502, + protocol: elbv2.Protocol.TCP_UDP, +}); +const tcpWithUdpTargetGroup = new elbv2.NetworkTargetGroup(stack, 'TcpWithUdpTargetGroup', { + vpc, + port: 3502, + protocol: elbv2.Protocol.TCP_UDP, + ipAddressType: elbv2.TargetGroupIpAddressType.IPV6, +}); +tcpWithUdpListener.addTargetGroups('TcpWithUdpTargetGroup', tcpWithUdpTargetGroup); + +new integ.IntegTest(app, 'NlbEnablePrefixForIpv6NatStackTest', { + testCases: [stack], +}); diff --git a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md index 2d839918f3cb8..f55effba63631 100644 --- a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md +++ b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md @@ -366,7 +366,6 @@ and [Register targets with your Target Group](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/target-group-register-targets.html) for more information. - ### Dualstack Network Load Balancer You can create a dualstack Network Load Balancer using the `ipAddressType` property: @@ -380,7 +379,23 @@ const lb = new elbv2.NetworkLoadBalancer(this, 'LB', { }); ``` -You cannot add UDP or TCP_UDP listeners to a dualstack Network Load Balancer. +You can configure whether to use an IPv6 prefix from each subnet for source NAT by setting `enablePrefixForIpv6SourceNat` to `true`. +This must be enabled if you want to create a dualstack Network Load Balancer with a listener that uses UDP protocol. + +```ts +declare const vpc: ec2.Vpc; + +const lb = new elbv2.NetworkLoadBalancer(this, 'LB', { + vpc, + ipAddressType: elbv2.IpAddressType.DUAL_STACK, + enablePrefixForIpv6SourceNat: true, +}); + +const listener = lb.addListener('Listener', { + port: 1229, + protocol: elbv2.Protocol.UDP, +}); +``` ### Network Load Balancer attributes diff --git a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts index 6ef0e006e088f..6b97718474c21 100644 --- a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts +++ b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts @@ -7,7 +7,7 @@ import * as cxschema from '../../../cloud-assembly-schema'; import { Duration, Resource, Lazy, Token } from '../../../core'; import { BaseListener, BaseListenerLookupOptions, IListener } from '../shared/base-listener'; import { HealthCheck } from '../shared/base-target-group'; -import { AlpnPolicy, IpAddressType, Protocol, SslPolicy } from '../shared/enums'; +import { AlpnPolicy, Protocol, SslPolicy } from '../shared/enums'; import { IListenerCertificate } from '../shared/listener-certificate'; import { validateNetworkProtocol } from '../shared/util'; @@ -195,13 +195,6 @@ export class NetworkListener extends BaseListener implements INetworkListener { throw new Error('Protocol must be TLS when alpnPolicy have been specified'); } - if ( - props.loadBalancer.ipAddressType === IpAddressType.DUAL_STACK && - (props.protocol === Protocol.UDP || props.protocol === Protocol.TCP_UDP) - ) { - throw new Error('UDP or TCP_UDP listeners cannot be added to a dualstack network load balancer.'); - } - super(scope, id, { loadBalancerArn: props.loadBalancer.loadBalancerArn, protocol: proto, diff --git a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts index a9284e8160d58..7a485b102155e 100644 --- a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts +++ b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts @@ -7,7 +7,7 @@ import { Lazy, Resource } from '../../../core'; import * as cxapi from '../../../cx-api'; import { NetworkELBMetrics } from '../elasticloadbalancingv2-canned-metrics.generated'; import { BaseLoadBalancer, BaseLoadBalancerLookupOptions, BaseLoadBalancerProps, ILoadBalancerV2 } from '../shared/base-load-balancer'; -import { IpAddressType } from '../shared/enums'; +import { IpAddressType, Protocol } from '../shared/enums'; import { parseLoadBalancerFullName } from '../shared/util'; /** @@ -75,6 +75,15 @@ export interface NetworkLoadBalancerProps extends BaseLoadBalancerProps { * @default false */ readonly zonalShift?: boolean; + + /** + * Indicates whether to use an IPv6 prefix from each subnet for source NAT. + * + * The IP address type must be IpAddressType.DUALSTACK. + * + * @default undefined - NLB default behavior is false + */ + readonly enablePrefixForIpv6SourceNat?: boolean; } /** @@ -241,6 +250,7 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa public readonly connections: ec2.Connections; private readonly isSecurityGroupsPropertyDefined: boolean; private readonly _enforceSecurityGroupInboundRulesOnPrivateLinkTraffic?: boolean; + private enablePrefixForIpv6SourceNat?: boolean; /** * After the implementation of `IConnectable` (see https://github.com/aws/aws-cdk/pull/28494), the default @@ -262,8 +272,10 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa enforceSecurityGroupInboundRulesOnPrivateLinkTraffic: Lazy.string({ produce: () => this.enforceSecurityGroupInboundRulesOnPrivateLinkTraffic, }), + enablePrefixForIpv6SourceNat: props.enablePrefixForIpv6SourceNat === true ? 'on': props.enablePrefixForIpv6SourceNat === false ? 'off' : undefined, }); + this.enablePrefixForIpv6SourceNat = props.enablePrefixForIpv6SourceNat; this.metrics = new NetworkLoadBalancerMetrics(this, this.loadBalancerFullName); this.isSecurityGroupsPropertyDefined = !!props.securityGroups; this.connections = new ec2.Connections({ securityGroups: props.securityGroups }); @@ -288,6 +300,14 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa * @returns The newly created listener */ public addListener(id: string, props: BaseNetworkListenerProps): NetworkListener { + // UDP listener with dual stack NLB requires prefix IPv6 source NAT to be enabled + if ( + (props.protocol === Protocol.UDP || props.protocol === Protocol.TCP_UDP) && + (this.ipAddressType === IpAddressType.DUAL_STACK || this.ipAddressType === IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4) && + this.enablePrefixForIpv6SourceNat !== true + ) { + throw new Error('To add a listener with UDP protocol to a dual stack NLB, \'enablePrefixForIpv6SourceNat\' must be set to true.'); + } return new NetworkListener(this, id, { loadBalancer: this, ...props, diff --git a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts index 6681443c6b1a9..1e0e6d602e23c 100644 --- a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts +++ b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/load-balancer.test.ts @@ -1135,40 +1135,51 @@ describe('tests', () => { IpAddressType: 'dualstack', }); }); + }); - test('Cannot add UDP or TCP_UDP listeners to a dualstack network load balancer', () => { + describe('enable prefix for ipv6 source nat', () => { + test.each([ + { config: true, value: 'on' }, + { config: false, value: 'off' }, + ])('specify EnablePrefixForIpv6SourceNat', ({ config, value }) => { // GIVEN const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'Stack'); // WHEN - const loadBalancer = new elbv2.NetworkLoadBalancer(stack, 'LB', { + new elbv2.NetworkLoadBalancer(stack, 'Lb', { vpc, - internetFacing: true, + enablePrefixForIpv6SourceNat: config, ipAddressType: elbv2.IpAddressType.DUAL_STACK, }); - const targetGroup = new elbv2.NetworkTargetGroup(stack, 'tg', { - vpc: loadBalancer.vpc, - port: 3000, + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ElasticLoadBalancingV2::LoadBalancer', { + Scheme: 'internal', + Type: 'network', + IpAddressType: 'dualstack', + EnablePrefixForIpv6SourceNat: value, + }); + }); + + test.each([false, undefined])('throw error for disabling `enablePrefixForIpv6SourceNat` and add UDP listener', (enablePrefixForIpv6SourceNat) => { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Stack'); + const lb = new elbv2.NetworkLoadBalancer(stack, 'Lb', { + vpc, + ipAddressType: elbv2.IpAddressType.DUAL_STACK, + enablePrefixForIpv6SourceNat, }); // THEN expect(() => { - loadBalancer.addListener('listener', { + lb.addListener('Listener', { + port: 80, protocol: elbv2.Protocol.UDP, - port: 3000, - defaultAction: elbv2.NetworkListenerAction.forward([targetGroup]), - }); - }).toThrow(/UDP or TCP_UDP listeners cannot be added to a dualstack network load balancer/); - - expect(() => { - loadBalancer.addListener('listener', { - protocol: elbv2.Protocol.TCP_UDP, - port: 3000, - defaultAction: elbv2.NetworkListenerAction.forward([targetGroup]), + defaultTargetGroups: [new elbv2.NetworkTargetGroup(stack, 'Group', { vpc, port: 80 })], }); - }).toThrow(/UDP or TCP_UDP listeners cannot be added to a dualstack network load balancer/); + }).toThrow('To add a listener with UDP protocol to a dual stack NLB, \'enablePrefixForIpv6SourceNat\' must be set to true.'); }); });