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(elbv2): support UDP and TCP_UDP protocols #4390

Merged
merged 7 commits into from
Oct 10, 2019
Merged

Conversation

nmussy
Copy link
Contributor

@nmussy nmussy commented Oct 7, 2019

Adds support for UDP and TCP_UDP protocol for NLB and health checks

  • Add UDP and TCP_UDP to Protocol
  • Document Protocol to indicate that HTTP and HTTPS cannot be used for NLB
  • Validate ALB health check protocols
  • Fix NLB health check protocol validation (was TLS|TCP, now HTTP|HTTPS|TCP)
  • Fix NLB test cases

References:

Fixes #4341
Fixes #3107


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

@nmussy nmussy requested a review from rix0rrr as a code owner October 7, 2019 09:00
@mergify
Copy link
Contributor

mergify bot commented Oct 7, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process

@nmussy
Copy link
Contributor Author

nmussy commented Oct 7, 2019

I preferred creating a new NetworkProtocol enum, to align it with the existing ApplicationProtocol. Tell me if you'd prefer we kept the existing Protocol for NLB.

Another consistency change we could do would be to rename Protocol into HealthCheckProtocol, but I'm not sure if it's worth another breaking change.

EDIT: A better thing would have been to @deprecate Protocol in favor of NetworkProtocol and HealthCheckProtocol.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@@ -26,7 +26,7 @@ export interface BaseNetworkListenerProps {
*
* @default - TLS if certificates are provided. TCP otherwise.
*/
readonly protocol?: Protocol;
readonly protocol?: NetworkProtocol;
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, but we can't have this. I don't think this is a good enough reason to break API compatibility.

I would be more in favor of adding TCP_UDP to the existing Protocol enum, noting in the docstring that it is only for NLBs, and adding runtime validation to make sure it isn't being used for ALBs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem! That what I did first, but I saw the lack of consistency with ALB and went for the breaking change. I'll update it.

@mergify mergify bot dismissed rix0rrr’s stale review October 10, 2019 08:59

Pull request has been modified.

@@ -215,7 +215,7 @@ export = {
port: 443,
protocol: elbv2.Protocol.TLS,
defaultTargetGroups: [new elbv2.NetworkTargetGroup(stack, 'Group', { vpc, port: 80 })]
}), Error, '/When the protocol is set to TLS, you must specify certificates/');
}), /When the protocol is set to TLS, you must specify certificates/);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When changing Invalid Protocol listener test, I noticed the error message wasn't actually checked. I fixed the next two tests as well

rix0rrr
rix0rrr previously approved these changes Oct 10, 2019
@nmussy nmussy closed this Oct 10, 2019
@nmussy
Copy link
Contributor Author

nmussy commented Oct 10, 2019

Just noticed I messed up something, I'll fix it and reopen, sorry

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@nmussy nmussy reopened this Oct 10, 2019
@mergify mergify bot dismissed rix0rrr’s stale review October 10, 2019 09:47

Pull request has been modified.

@@ -106,8 +106,8 @@ export class NetworkTargetGroup extends TargetGroupBase implements INetworkTarge
if (healthCheck.path) {
ret.push('Health check paths are not supported for Network Load Balancer health checks');
}
if (healthCheck.protocol && healthCheck.protocol !== Protocol.TCP && healthCheck.protocol !== Protocol.TLS) {
ret.push(`Health check protocol '${healthCheck.protocol}' is not supported. Must be one of [TCP, TLS]`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't the case according to the docs the docs:

HealthCheckProtocol
The possible protocols are HTTP, HTTPS, and TCP

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Oct 10, 2019

Thank you for contributing! Your pull request is now being automatically merged.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

1 similar comment
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 1958f26 into aws:master Oct 10, 2019
@nmussy nmussy deleted the 4341 branch October 10, 2019 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for TCP_UDP as a supported protocol Add support for UDP protocol in NLB
3 participants