Skip to content

Commit

Permalink
fix(elasticloadbalancingv2): cannot create UDP listener for dual-stac…
Browse files Browse the repository at this point in the history
…k NLB (aws#32184)

### Issue # (if applicable)

None

### Reason for this change

NetworkListener has the validation that it does not create UDP listeners for dual-stack NLB.

However, dual-stack NLB now supports the creation of UDP listeners, and this validation is no longer required.

<https://aws.amazon.com/about-aws/whats-new/2024/10/aws-udp-privatelink-dual-stack-network-load-balancers/?nc1=h_ls>

### Description of changes

- Remove this validation from NetworkListener class.

```ts
    if (
      props.loadBalancer.ipAddressType === IpAddressType.DUAL_STACK &&
      (props.protocol === Protocol.UDP || props.protocol === Protocol.TCP_UDP)
    ) {
      throw new Error('UDP or TCP_UDP listeners cannot be added to a dualstack network load balancer.');
    }
```

- Add `enablePrefixIpv6SourceNat` to the `NetworkLoadbalancerProps`
  - It is essential to enable this parameter for UDP listener with dual-stack NLB.
  - ref: aws#32184 (comment)

### Description of how you validated changes

Add both unit and integ tests.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
badmintoncryer authored Dec 9, 2024
1 parent 5ada161 commit e9c6e23
Show file tree
Hide file tree
Showing 13 changed files with 2,380 additions and 29 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e9c6e23

Please sign in to comment.