-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(elasticloadbalancingv2): cannot create UDP listener for dual-stack NLB #32184
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Exemption request |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32184 +/- ##
==========================================
+ Coverage 78.66% 78.67% +0.01%
==========================================
Files 107 107
Lines 7237 7237
Branches 1329 1329
==========================================
+ Hits 5693 5694 +1
+ Misses 1358 1357 -1
Partials 186 186
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making the change! Can you add an integration test to test the deployability with UDP as protocol?
Memo:I'll try to make integ test: import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as integ from '@aws-cdk/integ-tests-alpha';
import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
import { App, Stack } from 'aws-cdk-lib';
const app = new App();
const stack = new Stack(app, 'DualstackNlbUdpListenerStack');
const vpc = new ec2.Vpc(stack, 'Vpc', {
restrictDefaultSecurityGroup: false,
maxAzs: 2,
ipProtocol: ec2.IpProtocol.DUAL_STACK,
});
const nlb = new elbv2.NetworkLoadBalancer(stack, 'Nlb', {
vpc,
ipAddressType: elbv2.IpAddressType.DUAL_STACK,
});
const targetGroup = new elbv2.NetworkTargetGroup(stack, 'TargetGroup', {
vpc,
port: 12345,
protocol: elbv2.Protocol.UDP,
});
const listener = new elbv2.NetworkListener(stack, 'Listener', {
loadBalancer: nlb,
port: 12345,
protocol: elbv2.Protocol.UDP,
});
listener.addTargetGroups('TargetGroups', targetGroup);
new integ.IntegTest(app, 'DualstackNlbUdpListenerInteg', {
testCases: [stack],
}); Result: Failed resources:
DualstackNlbUdpListenerStack | 12:58:17 PM | CREATE_FAILED | AWS::ElasticLoadBalancingV2::Listener | Listener (Listener828B0E81) Resource handler returned message: "The specified listener protocol 'UDP' is not supported on load balancers using the 'dualstack' IP address type when 'EnablePrefixForIpv6SourceNat' is set to 'off' (Service: ElasticLoadBalancingV2, Status Code: 400, Request ID: 9bde532a-65ee-4d3c-b7f8-dd4226cf00aa)" (RequestToken: f44f72f5-c3f2-c539-ea85-986635ad31eb, HandlerErrorCode: InvalidRequest) |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Thank you for all the effort! Approved this PR. |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
@GavinZZ Thanks always!! |
@mergify update |
☑️ Nothing to do
|
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks:
You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
@mergify update |
☑️ Nothing to do
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
@mergify update |
✅ Branch has been successfully updated |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
@mergify update |
☑️ Nothing to do
|
@mergify update |
☑️ Nothing to do
|
@mergify update |
✅ Branch has been successfully updated |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
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
enablePrefixIpv6SourceNat
to theNetworkLoadbalancerProps
Description of how you validated changes
Add both unit and integ tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license