Skip to content

Commit 47a65db

Browse files
authored
feat(ec2): enabling features for ipv6 and dualstack support with corresponding unit tests (#33898)
Enabling features for ipv6 and dualstack support with corresponding unit tests ### Original PR: [#3873](#33873) ### Issue [#33493](#33493) Closes [#33493](#33493) ### Reason for this change Currently, AWS Services, i.e., Xray, Wafv2, Workmail, have started to release support for IPv6 or Dualstack for their VPC endpoints. We would like to modify our infrastructure to be able to support. these new IP address types. ### Description of changes 1. Passed necessary props to the VPC Endpoint interface 2. Added necessary props that need to be passed to enable all different IP address types 3. Abstracted address types as enum to abide by L1, L2 constructs 4. Added necessary unit tests to cover all cases 5. Added necessary changes to integ tests Added more detailed descriptions and guidlines for usage in the aws-ec2 README.md as well as very detailed comments above each code change. ### Description of how you validated changes Added unit tests and integ tests to cover all valid and invalid cases. Throws necessary errors according to [documentation](https://docs.aws.amazon.com/vpc/latest/privatelink/create-endpoint-service.html#connect-to-endpoint-service). Detailed descriptions of each case are outlined in comments. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
1 parent 1c0e03f commit 47a65db

File tree

10 files changed

+569
-1094
lines changed

10 files changed

+569
-1094
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-endpoint.lit.js.snapshot/aws-cdk-ec2-vpc-endpoint.assets.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-endpoint.lit.js.snapshot/aws-cdk-ec2-vpc-endpoint.template.json

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,104 @@
676676
"Ref": "MyVpcF9F0CA6F"
677677
}
678678
}
679+
},
680+
"MyVpcCloudwatchLogsEndpointSecurityGroup4A3B5DFB": {
681+
"Type": "AWS::EC2::SecurityGroup",
682+
"Properties": {
683+
"GroupDescription": "aws-cdk-ec2-vpc-endpoint/MyVpc/CloudwatchLogsEndpoint/SecurityGroup",
684+
"SecurityGroupEgress": [
685+
{
686+
"CidrIp": "0.0.0.0/0",
687+
"Description": "Allow all outbound traffic by default",
688+
"IpProtocol": "-1"
689+
}
690+
],
691+
"SecurityGroupIngress": [
692+
{
693+
"CidrIp": {
694+
"Fn::GetAtt": [
695+
"MyVpcF9F0CA6F",
696+
"CidrBlock"
697+
]
698+
},
699+
"Description": {
700+
"Fn::Join": [
701+
"",
702+
[
703+
"from ",
704+
{
705+
"Fn::GetAtt": [
706+
"MyVpcF9F0CA6F",
707+
"CidrBlock"
708+
]
709+
},
710+
":443"
711+
]
712+
]
713+
},
714+
"FromPort": 443,
715+
"IpProtocol": "tcp",
716+
"ToPort": 443
717+
}
718+
],
719+
"Tags": [
720+
{
721+
"Key": "Name",
722+
"Value": "aws-cdk-ec2-vpc-endpoint/MyVpc"
723+
}
724+
],
725+
"VpcId": {
726+
"Ref": "MyVpcF9F0CA6F"
727+
}
728+
}
729+
},
730+
"MyVpcCloudwatchLogsEndpointB1C11ADC": {
731+
"Type": "AWS::EC2::VPCEndpoint",
732+
"Properties": {
733+
"DnsOptions": {
734+
"DnsRecordIpType": "ipv4"
735+
},
736+
"IpAddressType": "ipv4",
737+
"PrivateDnsEnabled": true,
738+
"SecurityGroupIds": [
739+
{
740+
"Fn::GetAtt": [
741+
"MyVpcCloudwatchLogsEndpointSecurityGroup4A3B5DFB",
742+
"GroupId"
743+
]
744+
}
745+
],
746+
"ServiceName": {
747+
"Fn::Join": [
748+
"",
749+
[
750+
"com.amazonaws.",
751+
{
752+
"Ref": "AWS::Region"
753+
},
754+
".logs"
755+
]
756+
]
757+
},
758+
"SubnetIds": [
759+
{
760+
"Ref": "MyVpcPrivateSubnet1Subnet5057CF7E"
761+
},
762+
{
763+
"Ref": "MyVpcPrivateSubnet2Subnet0040C983"
764+
}
765+
],
766+
"Tags": [
767+
{
768+
"Key": "Name",
769+
"Value": "aws-cdk-ec2-vpc-endpoint/MyVpc"
770+
}
771+
],
772+
"VpcEndpointType": "Interface",
773+
"VpcId": {
774+
"Ref": "MyVpcF9F0CA6F"
775+
}
776+
}
679777
}
680778
},
681779
"Parameters": {

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-endpoint.lit.js.snapshot/cdk.out

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-endpoint.lit.js.snapshot/integ.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)