Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ec2): enabling features for ipv6 and dualstack support with corresponding unit tests #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlexanderJangAMZN
Copy link
Owner

@AlexanderJangAMZN AlexanderJangAMZN commented Mar 18, 2025

Enabling features for ipv6 and dualstack support with corresponding unit tests

Issue #33493

aws/aws-cdk#33493

Closes #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 IP address type through the constructor of where the VPC endpoint is being created
  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

Description of how you validated changes

Added unit tests to cover all valid and invalid cases. Throws error when IP address types don't match.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@AlexanderJangAMZN AlexanderJangAMZN changed the title feat(ec2): Enabling features for ipv6 and dualstack support with corresponding unit tests chore(ec2): enabling features for ipv6 and dualstack support with corresponding unit tests Mar 18, 2025
const stack = new Stack();
const vpc = new Vpc(stack, 'VpcNetwork');

// Invalid Combinations of ipAddressType and dnsRecordIpType

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is unnecessary

}).toThrow()
});

test.each([

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this test case we can remove the each and just test on one mismatch like IPv4 and Ipv6. Otherwise what we're doing here is testing js === on all potential values

@AlexanderJangAMZN AlexanderJangAMZN marked this pull request as ready for review March 19, 2025 22:42
@AlexanderJangAMZN AlexanderJangAMZN force-pushed the ipv6-dualstack-vpc-endpoints branch from 66b5df4 to 3222b32 Compare March 21, 2025 02:43
@AlexanderJangAMZN AlexanderJangAMZN changed the title chore(ec2): enabling features for ipv6 and dualstack support with corresponding unit tests feature(ec2): enabling features for ipv6 and dualstack support with corresponding unit tests Mar 21, 2025
@AlexanderJangAMZN AlexanderJangAMZN changed the title feature(ec2): enabling features for ipv6 and dualstack support with corresponding unit tests feat(ec2): enabling features for ipv6 and dualstack support with corresponding unit tests Mar 21, 2025
@AlexanderJangAMZN AlexanderJangAMZN force-pushed the ipv6-dualstack-vpc-endpoints branch from 3222b32 to d19a01f Compare March 22, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants