diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.assets.json new file mode 100644 index 0000000000000..267d3971cf8ff --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.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.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.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.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestStack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestStack.assets.json new file mode 100644 index 0000000000000..1e3ba451332b9 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestStack.assets.json @@ -0,0 +1,32 @@ +{ + "version": "38.0.1", + "files": { + "a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c": { + "source": { + "path": "asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "03976be104a0c543b1d266c3401be49cb0a85127f59bff731412267cfc179618": { + "source": { + "path": "AlbTargetGroupIpAddressTypeTestStack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "03976be104a0c543b1d266c3401be49cb0a85127f59bff731412267cfc179618.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.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestStack.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestStack.template.json new file mode 100644 index 0000000000000..d8dc83463f4c0 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/AlbTargetGroupIpAddressTypeTestStack.template.json @@ -0,0 +1,1148 @@ +{ + "Resources": { + "Ipv4Vpc1439105D": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc" + } + ] + } + }, + "Ipv4VpcPublicSubnet1SubnetEC9C8EC9": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcPublicSubnet1RouteTableF1965042": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcPublicSubnet1RouteTableAssociation5FC45ABA": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "Ipv4VpcPublicSubnet1RouteTableF1965042" + }, + "SubnetId": { + "Ref": "Ipv4VpcPublicSubnet1SubnetEC9C8EC9" + } + } + }, + "Ipv4VpcPublicSubnet1DefaultRoute0C4F086E": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "RouteTableId": { + "Ref": "Ipv4VpcPublicSubnet1RouteTableF1965042" + } + }, + "DependsOn": [ + "Ipv4VpcVPCGWF187A055" + ] + }, + "Ipv4VpcPublicSubnet2Subnet5F5E4544": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcPublicSubnet2RouteTableCAB310B5": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcPublicSubnet2RouteTableAssociation5294334B": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "Ipv4VpcPublicSubnet2RouteTableCAB310B5" + }, + "SubnetId": { + "Ref": "Ipv4VpcPublicSubnet2Subnet5F5E4544" + } + } + }, + "Ipv4VpcPublicSubnet2DefaultRoute826D6EFE": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "RouteTableId": { + "Ref": "Ipv4VpcPublicSubnet2RouteTableCAB310B5" + } + }, + "DependsOn": [ + "Ipv4VpcVPCGWF187A055" + ] + }, + "Ipv4VpcIsolatedSubnet1Subnet55C712BF": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Isolated" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcIsolatedSubnet1RouteTableA5641DD1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcIsolatedSubnet1RouteTableAssociationA9CD1AEE": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "Ipv4VpcIsolatedSubnet1RouteTableA5641DD1" + }, + "SubnetId": { + "Ref": "Ipv4VpcIsolatedSubnet1Subnet55C712BF" + } + } + }, + "Ipv4VpcIsolatedSubnet2Subnet30A426C1": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Isolated" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcIsolatedSubnet2RouteTable26B47FB4": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcIsolatedSubnet2RouteTableAssociationD5682B3F": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "Ipv4VpcIsolatedSubnet2RouteTable26B47FB4" + }, + "SubnetId": { + "Ref": "Ipv4VpcIsolatedSubnet2Subnet30A426C1" + } + } + }, + "Ipv4VpcIGW9797A423": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc" + } + ] + } + }, + "Ipv4VpcVPCGWF187A055": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcRestrictDefaultSecurityGroupCustomResource412C54F5": { + "Type": "Custom::VpcRestrictDefaultSG", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E", + "Arn" + ] + }, + "DefaultSecurityGroupId": { + "Fn::GetAtt": [ + "Ipv4Vpc1439105D", + "DefaultSecurityGroup" + ] + }, + "Account": { + "Ref": "AWS::AccountId" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ] + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } + ], + "Policies": [ + { + "PolicyName": "Inline", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "ec2:AuthorizeSecurityGroupIngress", + "ec2:AuthorizeSecurityGroupEgress", + "ec2:RevokeSecurityGroupIngress", + "ec2:RevokeSecurityGroupEgress" + ], + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":security-group/", + { + "Fn::GetAtt": [ + "Ipv4Vpc1439105D", + "DefaultSecurityGroup" + ] + } + ] + ] + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "ec2:AuthorizeSecurityGroupIngress", + "ec2:AuthorizeSecurityGroupEgress", + "ec2:RevokeSecurityGroupIngress", + "ec2:RevokeSecurityGroupEgress" + ], + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":security-group/", + { + "Fn::GetAtt": [ + "DualstackVpc3B16059D", + "DefaultSecurityGroup" + ] + } + ] + ] + } + ] + } + ] + } + } + ] + } + }, + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c.zip" + }, + "Timeout": 900, + "MemorySize": 128, + "Handler": "__entrypoint__.handler", + "Role": { + "Fn::GetAtt": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0", + "Arn" + ] + }, + "Runtime": { + "Fn::FindInMap": [ + "LatestNodeRuntimeMap", + { + "Ref": "AWS::Region" + }, + "value" + ] + }, + "Description": "Lambda function for removing all inbound/outbound rules from the VPC default security group" + }, + "DependsOn": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0" + ] + }, + "DualstackVpc3B16059D": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc" + } + ] + } + }, + "DualstackVpcipv6cidr98E23615": { + "Type": "AWS::EC2::VPCCidrBlock", + "Properties": { + "AmazonProvidedIpv6CidrBlock": true, + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "DualstackVpcPublicSubnet1Subnet345ABF6C": { + "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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet1RouteTable115D5C6A": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet1RouteTableAssociationC0CA8C6E": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + }, + "SubnetId": { + "Ref": "DualstackVpcPublicSubnet1Subnet345ABF6C" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet1DefaultRoute9CD4625F": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615", + "DualstackVpcVPCGWBFA6CC4A" + ] + }, + "DualstackVpcPublicSubnet1DefaultRoute6C2383FA6": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationIpv6CidrBlock": "::/0", + "GatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet2SubnetF7BFA8A4": { + "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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet2RouteTable0F548002": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet2RouteTableAssociationB96A93FE": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + }, + "SubnetId": { + "Ref": "DualstackVpcPublicSubnet2SubnetF7BFA8A4" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet2DefaultRouteBC53FA35": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615", + "DualstackVpcVPCGWBFA6CC4A" + ] + }, + "DualstackVpcPublicSubnet2DefaultRoute675820509": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationIpv6CidrBlock": "::/0", + "GatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet1SubnetDD7D99E1": { + "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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Isolated" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet1RouteTable0B40D8B6": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet1RouteTableAssociation86B9AE73": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "DualstackVpcIsolatedSubnet1RouteTable0B40D8B6" + }, + "SubnetId": { + "Ref": "DualstackVpcIsolatedSubnet1SubnetDD7D99E1" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet2Subnet88E17746": { + "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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Isolated" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet2RouteTableAEF5E608": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet2RouteTableAssociation8CD57CFF": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "DualstackVpcIsolatedSubnet2RouteTableAEF5E608" + }, + "SubnetId": { + "Ref": "DualstackVpcIsolatedSubnet2Subnet88E17746" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIGWED712EFF": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc" + } + ] + } + }, + "DualstackVpcVPCGWBFA6CC4A": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "DualstackVpcEIGW61425E04A": { + "Type": "AWS::EC2::EgressOnlyInternetGateway", + "Properties": { + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "DualstackVpcRestrictDefaultSecurityGroupCustomResource4FDA257A": { + "Type": "Custom::VpcRestrictDefaultSG", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E", + "Arn" + ] + }, + "DefaultSecurityGroupId": { + "Fn::GetAtt": [ + "DualstackVpc3B16059D", + "DefaultSecurityGroup" + ] + }, + "Account": { + "Ref": "AWS::AccountId" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Ipv4TargetGroupE427AE4A": { + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "Properties": { + "IpAddressType": "ipv4", + "Port": 80, + "Protocol": "HTTP", + "TargetGroupAttributes": [ + { + "Key": "stickiness.enabled", + "Value": "false" + } + ], + "TargetType": "instance", + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv6TargetGroup2FEE9CC5": { + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "Properties": { + "IpAddressType": "ipv6", + "Port": 80, + "Protocol": "HTTP", + "TargetGroupAttributes": [ + { + "Key": "stickiness.enabled", + "Value": "false" + } + ], + "TargetType": "instance", + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + } + }, + "Mappings": { + "LatestNodeRuntimeMap": { + "af-south-1": { + "value": "nodejs20.x" + }, + "ap-east-1": { + "value": "nodejs20.x" + }, + "ap-northeast-1": { + "value": "nodejs20.x" + }, + "ap-northeast-2": { + "value": "nodejs20.x" + }, + "ap-northeast-3": { + "value": "nodejs20.x" + }, + "ap-south-1": { + "value": "nodejs20.x" + }, + "ap-south-2": { + "value": "nodejs20.x" + }, + "ap-southeast-1": { + "value": "nodejs20.x" + }, + "ap-southeast-2": { + "value": "nodejs20.x" + }, + "ap-southeast-3": { + "value": "nodejs20.x" + }, + "ap-southeast-4": { + "value": "nodejs20.x" + }, + "ap-southeast-5": { + "value": "nodejs20.x" + }, + "ap-southeast-7": { + "value": "nodejs20.x" + }, + "ca-central-1": { + "value": "nodejs20.x" + }, + "ca-west-1": { + "value": "nodejs20.x" + }, + "cn-north-1": { + "value": "nodejs18.x" + }, + "cn-northwest-1": { + "value": "nodejs18.x" + }, + "eu-central-1": { + "value": "nodejs20.x" + }, + "eu-central-2": { + "value": "nodejs20.x" + }, + "eu-isoe-west-1": { + "value": "nodejs18.x" + }, + "eu-north-1": { + "value": "nodejs20.x" + }, + "eu-south-1": { + "value": "nodejs20.x" + }, + "eu-south-2": { + "value": "nodejs20.x" + }, + "eu-west-1": { + "value": "nodejs20.x" + }, + "eu-west-2": { + "value": "nodejs20.x" + }, + "eu-west-3": { + "value": "nodejs20.x" + }, + "il-central-1": { + "value": "nodejs20.x" + }, + "me-central-1": { + "value": "nodejs20.x" + }, + "me-south-1": { + "value": "nodejs20.x" + }, + "mx-central-1": { + "value": "nodejs20.x" + }, + "sa-east-1": { + "value": "nodejs20.x" + }, + "us-east-1": { + "value": "nodejs20.x" + }, + "us-east-2": { + "value": "nodejs20.x" + }, + "us-gov-east-1": { + "value": "nodejs18.x" + }, + "us-gov-west-1": { + "value": "nodejs18.x" + }, + "us-iso-east-1": { + "value": "nodejs18.x" + }, + "us-iso-west-1": { + "value": "nodejs18.x" + }, + "us-isob-east-1": { + "value": "nodejs18.x" + }, + "us-west-1": { + "value": "nodejs20.x" + }, + "us-west-2": { + "value": "nodejs20.x" + } + } + }, + "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.alb-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/__entrypoint__.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/__entrypoint__.js new file mode 100644 index 0000000000000..ff3a517fba12d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/__entrypoint__.js @@ -0,0 +1,155 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.external = void 0; +exports.handler = handler; +exports.withRetries = withRetries; +const https = require("https"); +const url = require("url"); +// for unit tests +exports.external = { + sendHttpRequest: defaultSendHttpRequest, + log: defaultLog, + includeStackTraces: true, + userHandlerIndex: './index', +}; +const CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; +const MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; +async function handler(event, context) { + const sanitizedEvent = { ...event, ResponseURL: '...' }; + exports.external.log(JSON.stringify(sanitizedEvent, undefined, 2)); + // ignore DELETE event when the physical resource ID is the marker that + // indicates that this DELETE is a subsequent DELETE to a failed CREATE + // operation. + if (event.RequestType === 'Delete' && event.PhysicalResourceId === CREATE_FAILED_PHYSICAL_ID_MARKER) { + exports.external.log('ignoring DELETE event caused by a failed CREATE event'); + await submitResponse('SUCCESS', event); + return; + } + try { + // invoke the user handler. this is intentionally inside the try-catch to + // ensure that if there is an error it's reported as a failure to + // cloudformation (otherwise cfn waits). + // eslint-disable-next-line @typescript-eslint/no-require-imports + const userHandler = require(exports.external.userHandlerIndex).handler; + const result = await userHandler(sanitizedEvent, context); + // validate user response and create the combined event + const responseEvent = renderResponse(event, result); + // submit to cfn as success + await submitResponse('SUCCESS', responseEvent); + } + catch (e) { + const resp = { + ...event, + Reason: exports.external.includeStackTraces ? e.stack : e.message, + }; + if (!resp.PhysicalResourceId) { + // special case: if CREATE fails, which usually implies, we usually don't + // have a physical resource id. in this case, the subsequent DELETE + // operation does not have any meaning, and will likely fail as well. to + // address this, we use a marker so the provider framework can simply + // ignore the subsequent DELETE. + if (event.RequestType === 'Create') { + exports.external.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); + resp.PhysicalResourceId = CREATE_FAILED_PHYSICAL_ID_MARKER; + } + else { + // otherwise, if PhysicalResourceId is not specified, something is + // terribly wrong because all other events should have an ID. + exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`); + } + } + // this is an actual error, fail the activity altogether and exist. + await submitResponse('FAILED', resp); + } +} +function renderResponse(cfnRequest, handlerResponse = {}) { + // if physical ID is not returned, we have some defaults for you based + // on the request type. + const physicalResourceId = handlerResponse.PhysicalResourceId ?? cfnRequest.PhysicalResourceId ?? cfnRequest.RequestId; + // if we are in DELETE and physical ID was changed, it's an error. + if (cfnRequest.RequestType === 'Delete' && physicalResourceId !== cfnRequest.PhysicalResourceId) { + throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`); + } + // merge request event and result event (result prevails). + return { + ...cfnRequest, + ...handlerResponse, + PhysicalResourceId: physicalResourceId, + }; +} +async function submitResponse(status, event) { + const json = { + Status: status, + Reason: event.Reason ?? status, + StackId: event.StackId, + RequestId: event.RequestId, + PhysicalResourceId: event.PhysicalResourceId || MISSING_PHYSICAL_ID_MARKER, + LogicalResourceId: event.LogicalResourceId, + NoEcho: event.NoEcho, + Data: event.Data, + }; + const parsedUrl = url.parse(event.ResponseURL); + const loggingSafeUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}/${parsedUrl.pathname}?***`; + exports.external.log('submit response to cloudformation', loggingSafeUrl, json); + const responseBody = JSON.stringify(json); + const req = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + const retryOptions = { + attempts: 5, + sleep: 1000, + }; + await withRetries(retryOptions, exports.external.sendHttpRequest)(req, responseBody); +} +async function defaultSendHttpRequest(options, requestBody) { + return new Promise((resolve, reject) => { + try { + const request = https.request(options, (response) => { + response.resume(); // Consume the response but don't care about it + if (!response.statusCode || response.statusCode >= 400) { + reject(new Error(`Unsuccessful HTTP response: ${response.statusCode}`)); + } + else { + resolve(); + } + }); + request.on('error', reject); + request.write(requestBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +function defaultLog(fmt, ...params) { + // eslint-disable-next-line no-console + console.log(fmt, ...params); +} +function withRetries(options, fn) { + return async (...xs) => { + let attempts = options.attempts; + let ms = options.sleep; + while (true) { + try { + return await fn(...xs); + } + catch (e) { + if (attempts-- <= 0) { + throw e; + } + await sleep(Math.floor(Math.random() * ms)); + ms *= 2; + } + } + }; +} +async function sleep(ms) { + return new Promise((ok) => setTimeout(ok, ms)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/index.js new file mode 100644 index 0000000000000..013bcaffd8fe5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/index.js @@ -0,0 +1 @@ +"use strict";var I=Object.create;var t=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var G=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},n=(r,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of P(e))!l.call(r,s)&&s!==o&&t(r,s,{get:()=>e[s],enumerable:!(i=y(e,s))||i.enumerable});return r};var R=(r,e,o)=>(o=r!=null?I(g(r)):{},n(e||!r||!r.__esModule?t(o,"default",{value:r,enumerable:!0}):o,r)),S=r=>n(t({},"__esModule",{value:!0}),r);var k={};G(k,{handler:()=>f});module.exports=S(k);var a=R(require("@aws-sdk/client-ec2")),u=new a.EC2({});function c(r,e){return{GroupId:r,IpPermissions:[{UserIdGroupPairs:[{GroupId:r,UserId:e}],IpProtocol:"-1"}]}}function d(r){return{GroupId:r,IpPermissions:[{IpRanges:[{CidrIp:"0.0.0.0/0"}],IpProtocol:"-1"}]}}async function f(r){let e=r.ResourceProperties.DefaultSecurityGroupId,o=r.ResourceProperties.Account;switch(r.RequestType){case"Create":return p(e,o);case"Update":return h(r);case"Delete":return m(e,o)}}async function h(r){let e=r.OldResourceProperties.DefaultSecurityGroupId,o=r.ResourceProperties.DefaultSecurityGroupId;e!==o&&(await m(e,r.ResourceProperties.Account),await p(o,r.ResourceProperties.Account))}async function p(r,e){try{await u.revokeSecurityGroupEgress(d(r))}catch(o){if(o.name!=="InvalidPermission.NotFound")throw o}try{await u.revokeSecurityGroupIngress(c(r,e))}catch(o){if(o.name!=="InvalidPermission.NotFound")throw o}}async function m(r,e){await u.authorizeSecurityGroupIngress(c(r,e)),await u.authorizeSecurityGroupEgress(d(r))}0&&(module.exports={handler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.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.alb-target-group-ip-address-type.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.alb-target-group-ip-address-type.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/integ.json new file mode 100644 index 0000000000000..5fd7ea08b7af5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "AlbTargetGroupIpAddressTypeTestInteg/DefaultTest": { + "stacks": [ + "AlbTargetGroupIpAddressTypeTestStack" + ], + "assertionStack": "AlbTargetGroupIpAddressTypeTestInteg/DefaultTest/DeployAssert", + "assertionStackName": "AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/manifest.json new file mode 100644 index 0000000000000..d78f1a96dcd30 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/manifest.json @@ -0,0 +1,383 @@ +{ + "version": "38.0.1", + "artifacts": { + "AlbTargetGroupIpAddressTypeTestStack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "AlbTargetGroupIpAddressTypeTestStack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "AlbTargetGroupIpAddressTypeTestStack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "AlbTargetGroupIpAddressTypeTestStack.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}/03976be104a0c543b1d266c3401be49cb0a85127f59bff731412267cfc179618.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "AlbTargetGroupIpAddressTypeTestStack.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": [ + "AlbTargetGroupIpAddressTypeTestStack.assets" + ], + "metadata": { + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4Vpc1439105D" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet1SubnetEC9C8EC9" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet1RouteTableF1965042" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet1RouteTableAssociation5FC45ABA" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet1DefaultRoute0C4F086E" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet2Subnet5F5E4544" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet2RouteTableCAB310B5" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet2RouteTableAssociation5294334B" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet2DefaultRoute826D6EFE" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet1Subnet55C712BF" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet1RouteTableA5641DD1" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet1RouteTableAssociationA9CD1AEE" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet2Subnet30A426C1" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet2RouteTable26B47FB4" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet2RouteTableAssociationD5682B3F" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIGW9797A423" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcVPCGWF187A055" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/RestrictDefaultSecurityGroupCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcRestrictDefaultSecurityGroupCustomResource412C54F5" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/LatestNodeRuntimeMap": [ + { + "type": "aws:cdk:logicalId", + "data": "LatestNodeRuntimeMap" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider/Handler": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpc3B16059D" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/ipv6cidr": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcipv6cidr98E23615" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet1Subnet345ABF6C" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet1RouteTableAssociationC0CA8C6E" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet1DefaultRoute9CD4625F" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/DefaultRoute6": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet1DefaultRoute6C2383FA6" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet2SubnetF7BFA8A4" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet2RouteTable0F548002" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet2RouteTableAssociationB96A93FE" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet2DefaultRouteBC53FA35" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/DefaultRoute6": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet2DefaultRoute675820509" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet1SubnetDD7D99E1" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet1RouteTable0B40D8B6" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet1RouteTableAssociation86B9AE73" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet2Subnet88E17746" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet2RouteTableAEF5E608" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet2RouteTableAssociation8CD57CFF" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIGWED712EFF" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcVPCGWBFA6CC4A" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/EIGW6": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcEIGW61425E04A" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/RestrictDefaultSecurityGroupCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcRestrictDefaultSecurityGroupCustomResource4FDA257A" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv4TargetGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4TargetGroupE427AE4A" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/Ipv6TargetGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv6TargetGroup2FEE9CC5" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/AlbTargetGroupIpAddressTypeTestStack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "AlbTargetGroupIpAddressTypeTestStack" + }, + "AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.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": [ + "AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.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": [ + "AlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssert7B27CD73.assets" + ], + "metadata": { + "/AlbTargetGroupIpAddressTypeTestInteg/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/AlbTargetGroupIpAddressTypeTestInteg/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "AlbTargetGroupIpAddressTypeTestInteg/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.alb-target-group-ip-address-type.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/tree.json new file mode 100644 index 0000000000000..4bf9bd6d5085f --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.js.snapshot/tree.json @@ -0,0 +1,1430 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "AlbTargetGroupIpAddressTypeTestStack": { + "id": "AlbTargetGroupIpAddressTypeTestStack", + "path": "AlbTargetGroupIpAddressTypeTestStack", + "children": { + "Ipv4Vpc": { + "id": "Ipv4Vpc", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/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": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "Ipv4VpcPublicSubnet1RouteTableF1965042" + }, + "subnetId": { + "Ref": "Ipv4VpcPublicSubnet1SubnetEC9C8EC9" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "routeTableId": { + "Ref": "Ipv4VpcPublicSubnet1RouteTableF1965042" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "Ipv4VpcPublicSubnet2RouteTableCAB310B5" + }, + "subnetId": { + "Ref": "Ipv4VpcPublicSubnet2Subnet5F5E4544" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "routeTableId": { + "Ref": "Ipv4VpcPublicSubnet2RouteTableCAB310B5" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IsolatedSubnet1": { + "id": "IsolatedSubnet1", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Isolated" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "Ipv4VpcIsolatedSubnet1RouteTableA5641DD1" + }, + "subnetId": { + "Ref": "Ipv4VpcIsolatedSubnet1Subnet55C712BF" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IsolatedSubnet2": { + "id": "IsolatedSubnet2", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Isolated" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "Ipv4VpcIsolatedSubnet2RouteTable26B47FB4" + }, + "subnetId": { + "Ref": "Ipv4VpcIsolatedSubnet2Subnet30A426C1" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IGW": { + "id": "IGW", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RestrictDefaultSecurityGroupCustomResource": { + "id": "RestrictDefaultSecurityGroupCustomResource", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/RestrictDefaultSecurityGroupCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/RestrictDefaultSecurityGroupCustomResource/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "LatestNodeRuntimeMap": { + "id": "LatestNodeRuntimeMap", + "path": "AlbTargetGroupIpAddressTypeTestStack/LatestNodeRuntimeMap", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Custom::VpcRestrictDefaultSGCustomResourceProvider": { + "id": "Custom::VpcRestrictDefaultSGCustomResourceProvider", + "path": "AlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider", + "children": { + "Staging": { + "id": "Staging", + "path": "AlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider/Staging", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Role": { + "id": "Role", + "path": "AlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Handler": { + "id": "Handler", + "path": "AlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider/Handler", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DualstackVpc": { + "id": "DualstackVpc", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc", + "children": { + "Resource": { + "id": "Resource", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/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": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "ipv6cidr": { + "id": "ipv6cidr", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/ipv6cidr", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCCidrBlock", + "aws:cdk:cloudformation:props": { + "amazonProvidedIpv6CidrBlock": true, + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + }, + "subnetId": { + "Ref": "DualstackVpcPublicSubnet1Subnet345ABF6C" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute6": { + "id": "DefaultRoute6", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/DefaultRoute6", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationIpv6CidrBlock": "::/0", + "gatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + }, + "subnetId": { + "Ref": "DualstackVpcPublicSubnet2SubnetF7BFA8A4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute6": { + "id": "DefaultRoute6", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/DefaultRoute6", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationIpv6CidrBlock": "::/0", + "gatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IsolatedSubnet1": { + "id": "IsolatedSubnet1", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Isolated" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "DualstackVpcIsolatedSubnet1RouteTable0B40D8B6" + }, + "subnetId": { + "Ref": "DualstackVpcIsolatedSubnet1SubnetDD7D99E1" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IsolatedSubnet2": { + "id": "IsolatedSubnet2", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Isolated" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "DualstackVpcIsolatedSubnet2RouteTableAEF5E608" + }, + "subnetId": { + "Ref": "DualstackVpcIsolatedSubnet2Subnet88E17746" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IGW": { + "id": "IGW", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "EIGW6": { + "id": "EIGW6", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/EIGW6", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EgressOnlyInternetGateway", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RestrictDefaultSecurityGroupCustomResource": { + "id": "RestrictDefaultSecurityGroupCustomResource", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/RestrictDefaultSecurityGroupCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "AlbTargetGroupIpAddressTypeTestStack/DualstackVpc/RestrictDefaultSecurityGroupCustomResource/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Ipv4TargetGroup": { + "id": "Ipv4TargetGroup", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4TargetGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv4TargetGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "aws:cdk:cloudformation:props": { + "ipAddressType": "ipv4", + "port": 80, + "protocol": "HTTP", + "targetGroupAttributes": [ + { + "key": "stickiness.enabled", + "value": "false" + } + ], + "targetType": "instance", + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Ipv6TargetGroup": { + "id": "Ipv6TargetGroup", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv6TargetGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "AlbTargetGroupIpAddressTypeTestStack/Ipv6TargetGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "aws:cdk:cloudformation:props": { + "ipAddressType": "ipv6", + "port": 80, + "protocol": "HTTP", + "targetGroupAttributes": [ + { + "key": "stickiness.enabled", + "value": "false" + } + ], + "targetType": "instance", + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "AlbTargetGroupIpAddressTypeTestStack/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "AlbTargetGroupIpAddressTypeTestStack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "AlbTargetGroupIpAddressTypeTestInteg": { + "id": "AlbTargetGroupIpAddressTypeTestInteg", + "path": "AlbTargetGroupIpAddressTypeTestInteg", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "AlbTargetGroupIpAddressTypeTestInteg/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "AlbTargetGroupIpAddressTypeTestInteg/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "AlbTargetGroupIpAddressTypeTestInteg/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "AlbTargetGroupIpAddressTypeTestInteg/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "AlbTargetGroupIpAddressTypeTestInteg/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.alb-target-group-ip-address-type.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.ts new file mode 100644 index 0000000000000..e7cee23dfda63 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb-target-group-ip-address-type.ts @@ -0,0 +1,40 @@ +import { Stack, App } from 'aws-cdk-lib'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2'; +import { Construct } from 'constructs'; + +class TestStack extends Stack { + constructor(scope: Construct, id: string) { + super(scope, id); + + const ipv4Vpc = new ec2.Vpc(this, 'Ipv4Vpc', { + natGateways: 0, + }); + const dualstackVpc = new ec2.Vpc(this, 'DualstackVpc', { + natGateways: 0, + ipProtocol: ec2.IpProtocol.DUAL_STACK, + }); + + new elbv2.ApplicationTargetGroup(this, 'Ipv4TargetGroup', { + vpc: ipv4Vpc, + port: 80, + targetType: elbv2.TargetType.INSTANCE, + ipAddressType: elbv2.TargetGroupIpAddressType.IPV4, + }); + + new elbv2.ApplicationTargetGroup(this, 'Ipv6TargetGroup', { + vpc: dualstackVpc, + port: 80, + targetType: elbv2.TargetType.INSTANCE, + ipAddressType: elbv2.TargetGroupIpAddressType.IPV6, + }); + } +} + +const app = new App(); +const stack = new TestStack(app, 'AlbTargetGroupIpAddressTypeTestStack'); + +new IntegTest(app, 'AlbTargetGroupIpAddressTypeTestInteg', { + testCases: [stack], +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.assets.json new file mode 100644 index 0000000000000..f301b1905e76d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.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-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.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-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestStack.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestStack.assets.json new file mode 100644 index 0000000000000..3b308edab1b46 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestStack.assets.json @@ -0,0 +1,32 @@ +{ + "version": "38.0.1", + "files": { + "a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c": { + "source": { + "path": "asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "5fd126c95e0a35d9624bd7cfea650858385eb2cddd41b05f01a16090c7e491ad": { + "source": { + "path": "NlbTargetGroupIpAddressTypeTestStack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "5fd126c95e0a35d9624bd7cfea650858385eb2cddd41b05f01a16090c7e491ad.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-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestStack.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestStack.template.json new file mode 100644 index 0000000000000..95654731fde4c --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/NlbTargetGroupIpAddressTypeTestStack.template.json @@ -0,0 +1,1136 @@ +{ + "Resources": { + "Ipv4Vpc1439105D": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc" + } + ] + } + }, + "Ipv4VpcPublicSubnet1SubnetEC9C8EC9": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcPublicSubnet1RouteTableF1965042": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcPublicSubnet1RouteTableAssociation5FC45ABA": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "Ipv4VpcPublicSubnet1RouteTableF1965042" + }, + "SubnetId": { + "Ref": "Ipv4VpcPublicSubnet1SubnetEC9C8EC9" + } + } + }, + "Ipv4VpcPublicSubnet1DefaultRoute0C4F086E": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "RouteTableId": { + "Ref": "Ipv4VpcPublicSubnet1RouteTableF1965042" + } + }, + "DependsOn": [ + "Ipv4VpcVPCGWF187A055" + ] + }, + "Ipv4VpcPublicSubnet2Subnet5F5E4544": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcPublicSubnet2RouteTableCAB310B5": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcPublicSubnet2RouteTableAssociation5294334B": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "Ipv4VpcPublicSubnet2RouteTableCAB310B5" + }, + "SubnetId": { + "Ref": "Ipv4VpcPublicSubnet2Subnet5F5E4544" + } + } + }, + "Ipv4VpcPublicSubnet2DefaultRoute826D6EFE": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "RouteTableId": { + "Ref": "Ipv4VpcPublicSubnet2RouteTableCAB310B5" + } + }, + "DependsOn": [ + "Ipv4VpcVPCGWF187A055" + ] + }, + "Ipv4VpcIsolatedSubnet1Subnet55C712BF": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Isolated" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcIsolatedSubnet1RouteTableA5641DD1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcIsolatedSubnet1RouteTableAssociationA9CD1AEE": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "Ipv4VpcIsolatedSubnet1RouteTableA5641DD1" + }, + "SubnetId": { + "Ref": "Ipv4VpcIsolatedSubnet1Subnet55C712BF" + } + } + }, + "Ipv4VpcIsolatedSubnet2Subnet30A426C1": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Isolated" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcIsolatedSubnet2RouteTable26B47FB4": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2" + } + ], + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcIsolatedSubnet2RouteTableAssociationD5682B3F": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "Ipv4VpcIsolatedSubnet2RouteTable26B47FB4" + }, + "SubnetId": { + "Ref": "Ipv4VpcIsolatedSubnet2Subnet30A426C1" + } + } + }, + "Ipv4VpcIGW9797A423": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc" + } + ] + } + }, + "Ipv4VpcVPCGWF187A055": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv4VpcRestrictDefaultSecurityGroupCustomResource412C54F5": { + "Type": "Custom::VpcRestrictDefaultSG", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E", + "Arn" + ] + }, + "DefaultSecurityGroupId": { + "Fn::GetAtt": [ + "Ipv4Vpc1439105D", + "DefaultSecurityGroup" + ] + }, + "Account": { + "Ref": "AWS::AccountId" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ] + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } + ], + "Policies": [ + { + "PolicyName": "Inline", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "ec2:AuthorizeSecurityGroupIngress", + "ec2:AuthorizeSecurityGroupEgress", + "ec2:RevokeSecurityGroupIngress", + "ec2:RevokeSecurityGroupEgress" + ], + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":security-group/", + { + "Fn::GetAtt": [ + "Ipv4Vpc1439105D", + "DefaultSecurityGroup" + ] + } + ] + ] + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "ec2:AuthorizeSecurityGroupIngress", + "ec2:AuthorizeSecurityGroupEgress", + "ec2:RevokeSecurityGroupIngress", + "ec2:RevokeSecurityGroupEgress" + ], + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":ec2:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":security-group/", + { + "Fn::GetAtt": [ + "DualstackVpc3B16059D", + "DefaultSecurityGroup" + ] + } + ] + ] + } + ] + } + ] + } + } + ] + } + }, + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c.zip" + }, + "Timeout": 900, + "MemorySize": 128, + "Handler": "__entrypoint__.handler", + "Role": { + "Fn::GetAtt": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0", + "Arn" + ] + }, + "Runtime": { + "Fn::FindInMap": [ + "LatestNodeRuntimeMap", + { + "Ref": "AWS::Region" + }, + "value" + ] + }, + "Description": "Lambda function for removing all inbound/outbound rules from the VPC default security group" + }, + "DependsOn": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0" + ] + }, + "DualstackVpc3B16059D": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc" + } + ] + } + }, + "DualstackVpcipv6cidr98E23615": { + "Type": "AWS::EC2::VPCCidrBlock", + "Properties": { + "AmazonProvidedIpv6CidrBlock": true, + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "DualstackVpcPublicSubnet1Subnet345ABF6C": { + "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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet1RouteTable115D5C6A": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet1RouteTableAssociationC0CA8C6E": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + }, + "SubnetId": { + "Ref": "DualstackVpcPublicSubnet1Subnet345ABF6C" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet1DefaultRoute9CD4625F": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615", + "DualstackVpcVPCGWBFA6CC4A" + ] + }, + "DualstackVpcPublicSubnet1DefaultRoute6C2383FA6": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationIpv6CidrBlock": "::/0", + "GatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet2SubnetF7BFA8A4": { + "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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet2RouteTable0F548002": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet2RouteTableAssociationB96A93FE": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + }, + "SubnetId": { + "Ref": "DualstackVpcPublicSubnet2SubnetF7BFA8A4" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcPublicSubnet2DefaultRouteBC53FA35": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615", + "DualstackVpcVPCGWBFA6CC4A" + ] + }, + "DualstackVpcPublicSubnet2DefaultRoute675820509": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationIpv6CidrBlock": "::/0", + "GatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "RouteTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet1SubnetDD7D99E1": { + "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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Isolated" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet1RouteTable0B40D8B6": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet1RouteTableAssociation86B9AE73": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "DualstackVpcIsolatedSubnet1RouteTable0B40D8B6" + }, + "SubnetId": { + "Ref": "DualstackVpcIsolatedSubnet1SubnetDD7D99E1" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet2Subnet88E17746": { + "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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Isolated" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet2RouteTableAEF5E608": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2" + } + ], + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIsolatedSubnet2RouteTableAssociation8CD57CFF": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "DualstackVpcIsolatedSubnet2RouteTableAEF5E608" + }, + "SubnetId": { + "Ref": "DualstackVpcIsolatedSubnet2Subnet88E17746" + } + }, + "DependsOn": [ + "DualstackVpcipv6cidr98E23615" + ] + }, + "DualstackVpcIGWED712EFF": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc" + } + ] + } + }, + "DualstackVpcVPCGWBFA6CC4A": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "DualstackVpcEIGW61425E04A": { + "Type": "AWS::EC2::EgressOnlyInternetGateway", + "Properties": { + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "DualstackVpcRestrictDefaultSecurityGroupCustomResource4FDA257A": { + "Type": "Custom::VpcRestrictDefaultSG", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E", + "Arn" + ] + }, + "DefaultSecurityGroupId": { + "Fn::GetAtt": [ + "DualstackVpc3B16059D", + "DefaultSecurityGroup" + ] + }, + "Account": { + "Ref": "AWS::AccountId" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "Ipv4TargetGroupE427AE4A": { + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "Properties": { + "IpAddressType": "ipv4", + "Port": 80, + "Protocol": "TCP", + "TargetType": "instance", + "VpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "Ipv6TargetGroup2FEE9CC5": { + "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "Properties": { + "IpAddressType": "ipv6", + "Port": 80, + "Protocol": "TCP", + "TargetType": "instance", + "VpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + } + }, + "Mappings": { + "LatestNodeRuntimeMap": { + "af-south-1": { + "value": "nodejs20.x" + }, + "ap-east-1": { + "value": "nodejs20.x" + }, + "ap-northeast-1": { + "value": "nodejs20.x" + }, + "ap-northeast-2": { + "value": "nodejs20.x" + }, + "ap-northeast-3": { + "value": "nodejs20.x" + }, + "ap-south-1": { + "value": "nodejs20.x" + }, + "ap-south-2": { + "value": "nodejs20.x" + }, + "ap-southeast-1": { + "value": "nodejs20.x" + }, + "ap-southeast-2": { + "value": "nodejs20.x" + }, + "ap-southeast-3": { + "value": "nodejs20.x" + }, + "ap-southeast-4": { + "value": "nodejs20.x" + }, + "ap-southeast-5": { + "value": "nodejs20.x" + }, + "ap-southeast-7": { + "value": "nodejs20.x" + }, + "ca-central-1": { + "value": "nodejs20.x" + }, + "ca-west-1": { + "value": "nodejs20.x" + }, + "cn-north-1": { + "value": "nodejs18.x" + }, + "cn-northwest-1": { + "value": "nodejs18.x" + }, + "eu-central-1": { + "value": "nodejs20.x" + }, + "eu-central-2": { + "value": "nodejs20.x" + }, + "eu-isoe-west-1": { + "value": "nodejs18.x" + }, + "eu-north-1": { + "value": "nodejs20.x" + }, + "eu-south-1": { + "value": "nodejs20.x" + }, + "eu-south-2": { + "value": "nodejs20.x" + }, + "eu-west-1": { + "value": "nodejs20.x" + }, + "eu-west-2": { + "value": "nodejs20.x" + }, + "eu-west-3": { + "value": "nodejs20.x" + }, + "il-central-1": { + "value": "nodejs20.x" + }, + "me-central-1": { + "value": "nodejs20.x" + }, + "me-south-1": { + "value": "nodejs20.x" + }, + "mx-central-1": { + "value": "nodejs20.x" + }, + "sa-east-1": { + "value": "nodejs20.x" + }, + "us-east-1": { + "value": "nodejs20.x" + }, + "us-east-2": { + "value": "nodejs20.x" + }, + "us-gov-east-1": { + "value": "nodejs18.x" + }, + "us-gov-west-1": { + "value": "nodejs18.x" + }, + "us-iso-east-1": { + "value": "nodejs18.x" + }, + "us-iso-west-1": { + "value": "nodejs18.x" + }, + "us-isob-east-1": { + "value": "nodejs18.x" + }, + "us-west-1": { + "value": "nodejs20.x" + }, + "us-west-2": { + "value": "nodejs20.x" + } + } + }, + "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-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/__entrypoint__.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/__entrypoint__.js new file mode 100644 index 0000000000000..ff3a517fba12d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/__entrypoint__.js @@ -0,0 +1,155 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.external = void 0; +exports.handler = handler; +exports.withRetries = withRetries; +const https = require("https"); +const url = require("url"); +// for unit tests +exports.external = { + sendHttpRequest: defaultSendHttpRequest, + log: defaultLog, + includeStackTraces: true, + userHandlerIndex: './index', +}; +const CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; +const MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; +async function handler(event, context) { + const sanitizedEvent = { ...event, ResponseURL: '...' }; + exports.external.log(JSON.stringify(sanitizedEvent, undefined, 2)); + // ignore DELETE event when the physical resource ID is the marker that + // indicates that this DELETE is a subsequent DELETE to a failed CREATE + // operation. + if (event.RequestType === 'Delete' && event.PhysicalResourceId === CREATE_FAILED_PHYSICAL_ID_MARKER) { + exports.external.log('ignoring DELETE event caused by a failed CREATE event'); + await submitResponse('SUCCESS', event); + return; + } + try { + // invoke the user handler. this is intentionally inside the try-catch to + // ensure that if there is an error it's reported as a failure to + // cloudformation (otherwise cfn waits). + // eslint-disable-next-line @typescript-eslint/no-require-imports + const userHandler = require(exports.external.userHandlerIndex).handler; + const result = await userHandler(sanitizedEvent, context); + // validate user response and create the combined event + const responseEvent = renderResponse(event, result); + // submit to cfn as success + await submitResponse('SUCCESS', responseEvent); + } + catch (e) { + const resp = { + ...event, + Reason: exports.external.includeStackTraces ? e.stack : e.message, + }; + if (!resp.PhysicalResourceId) { + // special case: if CREATE fails, which usually implies, we usually don't + // have a physical resource id. in this case, the subsequent DELETE + // operation does not have any meaning, and will likely fail as well. to + // address this, we use a marker so the provider framework can simply + // ignore the subsequent DELETE. + if (event.RequestType === 'Create') { + exports.external.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); + resp.PhysicalResourceId = CREATE_FAILED_PHYSICAL_ID_MARKER; + } + else { + // otherwise, if PhysicalResourceId is not specified, something is + // terribly wrong because all other events should have an ID. + exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`); + } + } + // this is an actual error, fail the activity altogether and exist. + await submitResponse('FAILED', resp); + } +} +function renderResponse(cfnRequest, handlerResponse = {}) { + // if physical ID is not returned, we have some defaults for you based + // on the request type. + const physicalResourceId = handlerResponse.PhysicalResourceId ?? cfnRequest.PhysicalResourceId ?? cfnRequest.RequestId; + // if we are in DELETE and physical ID was changed, it's an error. + if (cfnRequest.RequestType === 'Delete' && physicalResourceId !== cfnRequest.PhysicalResourceId) { + throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`); + } + // merge request event and result event (result prevails). + return { + ...cfnRequest, + ...handlerResponse, + PhysicalResourceId: physicalResourceId, + }; +} +async function submitResponse(status, event) { + const json = { + Status: status, + Reason: event.Reason ?? status, + StackId: event.StackId, + RequestId: event.RequestId, + PhysicalResourceId: event.PhysicalResourceId || MISSING_PHYSICAL_ID_MARKER, + LogicalResourceId: event.LogicalResourceId, + NoEcho: event.NoEcho, + Data: event.Data, + }; + const parsedUrl = url.parse(event.ResponseURL); + const loggingSafeUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}/${parsedUrl.pathname}?***`; + exports.external.log('submit response to cloudformation', loggingSafeUrl, json); + const responseBody = JSON.stringify(json); + const req = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': Buffer.byteLength(responseBody, 'utf8'), + }, + }; + const retryOptions = { + attempts: 5, + sleep: 1000, + }; + await withRetries(retryOptions, exports.external.sendHttpRequest)(req, responseBody); +} +async function defaultSendHttpRequest(options, requestBody) { + return new Promise((resolve, reject) => { + try { + const request = https.request(options, (response) => { + response.resume(); // Consume the response but don't care about it + if (!response.statusCode || response.statusCode >= 400) { + reject(new Error(`Unsuccessful HTTP response: ${response.statusCode}`)); + } + else { + resolve(); + } + }); + request.on('error', reject); + request.write(requestBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +function defaultLog(fmt, ...params) { + // eslint-disable-next-line no-console + console.log(fmt, ...params); +} +function withRetries(options, fn) { + return async (...xs) => { + let attempts = options.attempts; + let ms = options.sleep; + while (true) { + try { + return await fn(...xs); + } + catch (e) { + if (attempts-- <= 0) { + throw e; + } + await sleep(Math.floor(Math.random() * ms)); + ms *= 2; + } + } + }; +} +async function sleep(ms) { + return new Promise((ok) => setTimeout(ok, ms)); +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/index.js new file mode 100644 index 0000000000000..013bcaffd8fe5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/asset.a1acfc2b5f4f6b183fd2bb9863f486bc5edef6a357b355a070d9a0e502df418c/index.js @@ -0,0 +1 @@ +"use strict";var I=Object.create;var t=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var G=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},n=(r,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of P(e))!l.call(r,s)&&s!==o&&t(r,s,{get:()=>e[s],enumerable:!(i=y(e,s))||i.enumerable});return r};var R=(r,e,o)=>(o=r!=null?I(g(r)):{},n(e||!r||!r.__esModule?t(o,"default",{value:r,enumerable:!0}):o,r)),S=r=>n(t({},"__esModule",{value:!0}),r);var k={};G(k,{handler:()=>f});module.exports=S(k);var a=R(require("@aws-sdk/client-ec2")),u=new a.EC2({});function c(r,e){return{GroupId:r,IpPermissions:[{UserIdGroupPairs:[{GroupId:r,UserId:e}],IpProtocol:"-1"}]}}function d(r){return{GroupId:r,IpPermissions:[{IpRanges:[{CidrIp:"0.0.0.0/0"}],IpProtocol:"-1"}]}}async function f(r){let e=r.ResourceProperties.DefaultSecurityGroupId,o=r.ResourceProperties.Account;switch(r.RequestType){case"Create":return p(e,o);case"Update":return h(r);case"Delete":return m(e,o)}}async function h(r){let e=r.OldResourceProperties.DefaultSecurityGroupId,o=r.ResourceProperties.DefaultSecurityGroupId;e!==o&&(await m(e,r.ResourceProperties.Account),await p(o,r.ResourceProperties.Account))}async function p(r,e){try{await u.revokeSecurityGroupEgress(d(r))}catch(o){if(o.name!=="InvalidPermission.NotFound")throw o}try{await u.revokeSecurityGroupIngress(c(r,e))}catch(o){if(o.name!=="InvalidPermission.NotFound")throw o}}async function m(r,e){await u.authorizeSecurityGroupIngress(c(r,e)),await u.authorizeSecurityGroupEgress(d(r))}0&&(module.exports={handler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.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-target-group-ip-address-type.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-target-group-ip-address-type.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/integ.json new file mode 100644 index 0000000000000..8db802ca31d79 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "NlbTargetGroupIpAddressTypeTestInteg/DefaultTest": { + "stacks": [ + "NlbTargetGroupIpAddressTypeTestStack" + ], + "assertionStack": "NlbTargetGroupIpAddressTypeTestInteg/DefaultTest/DeployAssert", + "assertionStackName": "NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/manifest.json new file mode 100644 index 0000000000000..286c4faeda62a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/manifest.json @@ -0,0 +1,383 @@ +{ + "version": "38.0.1", + "artifacts": { + "NlbTargetGroupIpAddressTypeTestStack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "NlbTargetGroupIpAddressTypeTestStack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "NlbTargetGroupIpAddressTypeTestStack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "NlbTargetGroupIpAddressTypeTestStack.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}/5fd126c95e0a35d9624bd7cfea650858385eb2cddd41b05f01a16090c7e491ad.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "NlbTargetGroupIpAddressTypeTestStack.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": [ + "NlbTargetGroupIpAddressTypeTestStack.assets" + ], + "metadata": { + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4Vpc1439105D" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet1SubnetEC9C8EC9" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet1RouteTableF1965042" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet1RouteTableAssociation5FC45ABA" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet1DefaultRoute0C4F086E" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet2Subnet5F5E4544" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet2RouteTableCAB310B5" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet2RouteTableAssociation5294334B" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcPublicSubnet2DefaultRoute826D6EFE" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet1Subnet55C712BF" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet1RouteTableA5641DD1" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet1RouteTableAssociationA9CD1AEE" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet2Subnet30A426C1" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet2RouteTable26B47FB4" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIsolatedSubnet2RouteTableAssociationD5682B3F" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcIGW9797A423" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcVPCGWF187A055" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/RestrictDefaultSecurityGroupCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4VpcRestrictDefaultSecurityGroupCustomResource412C54F5" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/LatestNodeRuntimeMap": [ + { + "type": "aws:cdk:logicalId", + "data": "LatestNodeRuntimeMap" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomVpcRestrictDefaultSGCustomResourceProviderRole26592FE0" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider/Handler": [ + { + "type": "aws:cdk:logicalId", + "data": "CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpc3B16059D" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/ipv6cidr": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcipv6cidr98E23615" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet1Subnet345ABF6C" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet1RouteTableAssociationC0CA8C6E" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet1DefaultRoute9CD4625F" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/DefaultRoute6": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet1DefaultRoute6C2383FA6" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet2SubnetF7BFA8A4" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet2RouteTable0F548002" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet2RouteTableAssociationB96A93FE" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet2DefaultRouteBC53FA35" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/DefaultRoute6": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcPublicSubnet2DefaultRoute675820509" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet1SubnetDD7D99E1" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet1RouteTable0B40D8B6" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet1RouteTableAssociation86B9AE73" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet2Subnet88E17746" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet2RouteTableAEF5E608" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIsolatedSubnet2RouteTableAssociation8CD57CFF" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcIGWED712EFF" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcVPCGWBFA6CC4A" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/EIGW6": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcEIGW61425E04A" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/RestrictDefaultSecurityGroupCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "DualstackVpcRestrictDefaultSecurityGroupCustomResource4FDA257A" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv4TargetGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv4TargetGroupE427AE4A" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/Ipv6TargetGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Ipv6TargetGroup2FEE9CC5" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/NlbTargetGroupIpAddressTypeTestStack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "NlbTargetGroupIpAddressTypeTestStack" + }, + "NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.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": [ + "NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.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": [ + "NlbTargetGroupIpAddressTypeTestIntegDefaultTestDeployAssertF4BE6039.assets" + ], + "metadata": { + "/NlbTargetGroupIpAddressTypeTestInteg/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/NlbTargetGroupIpAddressTypeTestInteg/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "NlbTargetGroupIpAddressTypeTestInteg/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-target-group-ip-address-type.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/tree.json new file mode 100644 index 0000000000000..f0220b0db517d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.js.snapshot/tree.json @@ -0,0 +1,1418 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "NlbTargetGroupIpAddressTypeTestStack": { + "id": "NlbTargetGroupIpAddressTypeTestStack", + "path": "NlbTargetGroupIpAddressTypeTestStack", + "children": { + "Ipv4Vpc": { + "id": "Ipv4Vpc", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/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": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "Ipv4VpcPublicSubnet1RouteTableF1965042" + }, + "subnetId": { + "Ref": "Ipv4VpcPublicSubnet1SubnetEC9C8EC9" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "routeTableId": { + "Ref": "Ipv4VpcPublicSubnet1RouteTableF1965042" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "Ipv4VpcPublicSubnet2RouteTableCAB310B5" + }, + "subnetId": { + "Ref": "Ipv4VpcPublicSubnet2Subnet5F5E4544" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "routeTableId": { + "Ref": "Ipv4VpcPublicSubnet2RouteTableCAB310B5" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IsolatedSubnet1": { + "id": "IsolatedSubnet1", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Isolated" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "Ipv4VpcIsolatedSubnet1RouteTableA5641DD1" + }, + "subnetId": { + "Ref": "Ipv4VpcIsolatedSubnet1Subnet55C712BF" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IsolatedSubnet2": { + "id": "IsolatedSubnet2", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Isolated" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2" + } + ], + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IsolatedSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "Ipv4VpcIsolatedSubnet2RouteTable26B47FB4" + }, + "subnetId": { + "Ref": "Ipv4VpcIsolatedSubnet2Subnet30A426C1" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IGW": { + "id": "IGW", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "Ipv4VpcIGW9797A423" + }, + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RestrictDefaultSecurityGroupCustomResource": { + "id": "RestrictDefaultSecurityGroupCustomResource", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/RestrictDefaultSecurityGroupCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4Vpc/RestrictDefaultSecurityGroupCustomResource/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "LatestNodeRuntimeMap": { + "id": "LatestNodeRuntimeMap", + "path": "NlbTargetGroupIpAddressTypeTestStack/LatestNodeRuntimeMap", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Custom::VpcRestrictDefaultSGCustomResourceProvider": { + "id": "Custom::VpcRestrictDefaultSGCustomResourceProvider", + "path": "NlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider", + "children": { + "Staging": { + "id": "Staging", + "path": "NlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider/Staging", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Role": { + "id": "Role", + "path": "NlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Handler": { + "id": "Handler", + "path": "NlbTargetGroupIpAddressTypeTestStack/Custom::VpcRestrictDefaultSGCustomResourceProvider/Handler", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DualstackVpc": { + "id": "DualstackVpc", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/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": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "ipv6cidr": { + "id": "ipv6cidr", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/ipv6cidr", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCCidrBlock", + "aws:cdk:cloudformation:props": { + "amazonProvidedIpv6CidrBlock": true, + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + }, + "subnetId": { + "Ref": "DualstackVpcPublicSubnet1Subnet345ABF6C" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute6": { + "id": "DefaultRoute6", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet1/DefaultRoute6", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationIpv6CidrBlock": "::/0", + "gatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet1RouteTable115D5C6A" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + }, + "subnetId": { + "Ref": "DualstackVpcPublicSubnet2SubnetF7BFA8A4" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DefaultRoute6": { + "id": "DefaultRoute6", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/PublicSubnet2/DefaultRoute6", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationIpv6CidrBlock": "::/0", + "gatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "routeTableId": { + "Ref": "DualstackVpcPublicSubnet2RouteTable0F548002" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IsolatedSubnet1": { + "id": "IsolatedSubnet1", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Isolated" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "DualstackVpcIsolatedSubnet1RouteTable0B40D8B6" + }, + "subnetId": { + "Ref": "DualstackVpcIsolatedSubnet1SubnetDD7D99E1" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IsolatedSubnet2": { + "id": "IsolatedSubnet2", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/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": [ + "DualstackVpc3B16059D", + "Ipv6CidrBlocks" + ] + } + ] + }, + 4, + "64" + ] + } + ] + }, + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Isolated" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Acl": { + "id": "Acl", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2" + } + ], + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IsolatedSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "DualstackVpcIsolatedSubnet2RouteTableAEF5E608" + }, + "subnetId": { + "Ref": "DualstackVpcIsolatedSubnet2Subnet88E17746" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "IGW": { + "id": "IGW", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "DualstackVpcIGWED712EFF" + }, + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "EIGW6": { + "id": "EIGW6", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/EIGW6", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EgressOnlyInternetGateway", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "RestrictDefaultSecurityGroupCustomResource": { + "id": "RestrictDefaultSecurityGroupCustomResource", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/RestrictDefaultSecurityGroupCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "NlbTargetGroupIpAddressTypeTestStack/DualstackVpc/RestrictDefaultSecurityGroupCustomResource/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Ipv4TargetGroup": { + "id": "Ipv4TargetGroup", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4TargetGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv4TargetGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "aws:cdk:cloudformation:props": { + "ipAddressType": "ipv4", + "port": 80, + "protocol": "TCP", + "targetType": "instance", + "vpcId": { + "Ref": "Ipv4Vpc1439105D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "Ipv6TargetGroup": { + "id": "Ipv6TargetGroup", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv6TargetGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "NlbTargetGroupIpAddressTypeTestStack/Ipv6TargetGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ElasticLoadBalancingV2::TargetGroup", + "aws:cdk:cloudformation:props": { + "ipAddressType": "ipv6", + "port": 80, + "protocol": "TCP", + "targetType": "instance", + "vpcId": { + "Ref": "DualstackVpc3B16059D" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "NlbTargetGroupIpAddressTypeTestStack/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "NlbTargetGroupIpAddressTypeTestStack/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "NlbTargetGroupIpAddressTypeTestInteg": { + "id": "NlbTargetGroupIpAddressTypeTestInteg", + "path": "NlbTargetGroupIpAddressTypeTestInteg", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "NlbTargetGroupIpAddressTypeTestInteg/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "NlbTargetGroupIpAddressTypeTestInteg/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "NlbTargetGroupIpAddressTypeTestInteg/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "NlbTargetGroupIpAddressTypeTestInteg/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "NlbTargetGroupIpAddressTypeTestInteg/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-target-group-ip-address-type.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.ts new file mode 100644 index 0000000000000..5058d5b45d9a0 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.nlb-target-group-ip-address-type.ts @@ -0,0 +1,40 @@ +import { Stack, App } from 'aws-cdk-lib'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2'; +import { Construct } from 'constructs'; + +class TestStack extends Stack { + constructor(scope: Construct, id: string) { + super(scope, id); + + const ipv4Vpc = new ec2.Vpc(this, 'Ipv4Vpc', { + natGateways: 0, + }); + const dualstackVpc = new ec2.Vpc(this, 'DualstackVpc', { + natGateways: 0, + ipProtocol: ec2.IpProtocol.DUAL_STACK, + }); + + new elbv2.NetworkTargetGroup(this, 'Ipv4TargetGroup', { + vpc: ipv4Vpc, + port: 80, + targetType: elbv2.TargetType.INSTANCE, + ipAddressType: elbv2.TargetGroupIpAddressType.IPV4, + }); + + new elbv2.NetworkTargetGroup(this, 'Ipv6TargetGroup', { + vpc: dualstackVpc, + port: 80, + targetType: elbv2.TargetType.INSTANCE, + ipAddressType: elbv2.TargetGroupIpAddressType.IPV6, + }); + } +} + +const app = new App(); +const stack = new TestStack(app, 'NlbTargetGroupIpAddressTypeTestStack'); + +new IntegTest(app, 'NlbTargetGroupIpAddressTypeTestInteg', { + testCases: [stack], +}); diff --git a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md index 44eb6dac002df..2d839918f3cb8 100644 --- a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md +++ b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md @@ -578,6 +578,46 @@ const targetGroup = new elbv2.ApplicationTargetGroup(this, 'TargetGroup', { }); ``` +### IP Address Type for Target Groups + +You can set the IP address type for the target group by setting the `ipAddressType` property for both Application and Network target groups. + +If you set the `ipAddressType` property to `IPV6`, the VPC for the target group must have an associated IPv6 CIDR block. + +For more information, see IP address type for [Network Load Balancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#target-group-ip-address-type) and [Application Load Balancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#target-group-ip-address-type). + +```ts +declare const vpc: ec2.Vpc; + +const ipv4ApplicationTargetGroup = new elbv2.ApplicationTargetGroup(this, 'IPv4ApplicationTargetGroup', { + vpc, + port: 80, + targetType: elbv2.TargetType.INSTANCE, + ipAddressType: elbv2.TargetGroupIpAddressType.IPV4, +}); + +const ipv6ApplicationTargetGroup = new elbv2.ApplicationTargetGroup(this, 'Ipv6ApplicationTargetGroup', { + vpc, + port: 80, + targetType: elbv2.TargetType.INSTANCE, + ipAddressType: elbv2.TargetGroupIpAddressType.IPV6, +}); + +const ipv4NetworkTargetGroup = new elbv2.NetworkTargetGroup(this, 'IPv4NetworkTargetGroup', { + vpc, + port: 80, + targetType: elbv2.TargetType.INSTANCE, + ipAddressType: elbv2.TargetGroupIpAddressType.IPV4, +}); + +const ipv6NetworkTargetGroup = new elbv2.NetworkTargetGroup(this, 'Ipv6NetworkTargetGroup', { + vpc, + port: 80, + targetType: elbv2.TargetType.INSTANCE, + ipAddressType: elbv2.TargetGroupIpAddressType.IPV6, +}); +``` + ## Using Lambda Targets To use a Lambda Function as a target, use the integration class in the diff --git a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts index fe9a7cf9e17c5..335670918ac83 100644 --- a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts +++ b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts @@ -5,6 +5,21 @@ import * as ec2 from '../../../aws-ec2'; import * as cdk from '../../../core'; import { CfnTargetGroup } from '../elasticloadbalancingv2.generated'; +/** + * The IP address type of targets registered with a target group + */ +export enum TargetGroupIpAddressType { + /** + * IPv4 addresses + */ + IPV4 = 'ipv4', + + /** + * IPv6 addresses + */ + IPV6 = 'ipv6', +} + /** * Basic properties of both Application and Network Target Groups */ @@ -64,6 +79,13 @@ export interface BaseTargetGroupProps { * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-targetgroup-targetgroupattribute.html */ readonly crossZoneEnabled?: boolean; + + /** + * The type of IP addresses of the targets registered with the target group. + * + * @default undefined - ELB defaults to IPv4 + */ + readonly ipAddressType?: TargetGroupIpAddressType; } /** @@ -84,7 +106,7 @@ export interface HealthCheck { * The approximate number of seconds between health checks for an individual target. * Must be 5 to 300 seconds * - * @default 10 seconds if protocol is `GENEVE`, 35 seconds if target type is `lambda`, else 30 seconds + * @default - 10 seconds if protocol is `GENEVE`, 35 seconds if target type is `lambda`, else 30 seconds */ readonly interval?: cdk.Duration; @@ -108,7 +130,7 @@ export interface HealthCheck { * The TCP protocol is supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. * The TLS, UDP, and TCP_UDP protocols are not supported for health checks. * - * @default HTTP for ALBs, TCP for NLBs + * @default - HTTP for ALBs, TCP for NLBs */ readonly protocol?: Protocol; @@ -116,7 +138,7 @@ export interface HealthCheck { * The amount of time, in seconds, during which no response from a target means a failed health check. * Must be 2 to 120 seconds. * - * @default 6 seconds if the protocol is HTTP, 5 seconds if protocol is `GENEVE`, 30 seconds if target type is `lambda`, 10 seconds for TCP, TLS, or HTTPS + * @default - 6 seconds if the protocol is HTTP, 5 seconds if protocol is `GENEVE`, 30 seconds if target type is `lambda`, 10 seconds for TCP, TLS, or HTTPS */ readonly timeout?: cdk.Duration; @@ -125,7 +147,7 @@ export interface HealthCheck { * * For Application Load Balancers, the default is 5. For Network Load Balancers, the default is 3. * - * @default 5 for ALBs, 3 for NLBs + * @default - 5 for ALBs, 3 for NLBs */ readonly healthyThresholdCount?: number; @@ -145,7 +167,7 @@ export interface HealthCheck { * You can specify values between 0 and 99. You can specify multiple values * (for example, "0,1") or a range of values (for example, "0-5"). * - * @default - 12 + * @default 12 */ readonly healthyGrpcCodes?: string; @@ -281,6 +303,7 @@ export abstract class TargetGroupBase extends Construct implements ITargetGroup httpCode: this.healthCheck.healthyHttpCodes, } : undefined, }), + ipAddressType: baseProps.ipAddressType, ...additionalProps, }); diff --git a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/alb/target-group.test.ts b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/alb/target-group.test.ts index 0dc5f3220c38e..64a77b3b42a0c 100644 --- a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/alb/target-group.test.ts +++ b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/alb/target-group.test.ts @@ -147,6 +147,23 @@ describe('tests', () => { }); }); + test.each([ + elbv2.TargetGroupIpAddressType.IPV4, + elbv2.TargetGroupIpAddressType.IPV6, + ])('configure IP address type %s', (ipAddressType) => { + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Vpc'); + + new elbv2.ApplicationTargetGroup(stack, 'Group', { + vpc, + ipAddressType, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::ElasticLoadBalancingV2::TargetGroup', { + IpAddressType: ipAddressType, + }); + }); + test('Load balancer duration cookie stickiness', () => { // GIVEN const app = new cdk.App(); diff --git a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/target-group.test.ts b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/target-group.test.ts index ddd063b9dd892..ca811868b87a0 100644 --- a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/target-group.test.ts +++ b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/target-group.test.ts @@ -163,6 +163,24 @@ describe('tests', () => { }).toThrow('Health check interval must be greater than or equal to the timeout; received interval 10, timeout 20.'); }); + test.each([ + elbv2.TargetGroupIpAddressType.IPV4, + elbv2.TargetGroupIpAddressType.IPV6, + ])('configure IP address type %s', (ipAddressType) => { + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'Vpc'); + + new elbv2.NetworkTargetGroup(stack, 'Group', { + vpc, + port: 80, + ipAddressType, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::ElasticLoadBalancingV2::TargetGroup', { + IpAddressType: ipAddressType, + }); + }); + // for backwards compatibility these can be equal, see discussion in https://github.com/aws/aws-cdk/pull/26031 test('No error for health check interval == timeout', () => { const app = new cdk.App();