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

fix(elasticloadbalancingv2): Incorrect validation on NetworkLoadBalancer.configureHealthCheck() #16445

Merged
merged 7 commits into from Sep 29, 2021

Conversation

ryparker
Copy link
Contributor

@ryparker ryparker commented Sep 9, 2021

Summary

The NetworkLoadBalancer's configureHealthCheck() method is incorrectly throwing a validation error when provided a valid protocol and the same value for both interval and timeout.

Error: Healthcheck interval 10 seconds must be greater than the timeout 10 seconds

This rule only applies to Application Load Balancers and not Network Load Balancers.

This PR:

  • Moves the mentioned validation logic from the BaseTargetGroup class to the ApplicationTargetGroup class.
  • Adds tests that check a validation error is thrown when invalid protocol, interval, timeout, & path combinations are provided for the respected TargetGroup type.
  • Adds tests that check a validation error is not thrown when valid protocol, interval, timeout, & path combinations are provided for the respected TargetGroup type.

Provides fix for SIM ticket: V427669955
Fixes issue: #16446

Refs:


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

@gitpod-io
Copy link

gitpod-io bot commented Sep 9, 2021

@ryparker ryparker added the contribution/core This is a PR that came from AWS. label Sep 22, 2021
@ryparker
Copy link
Contributor Author

@njlynch Anything I can do to help get this through?

@ryparker ryparker added the p1 label Sep 28, 2021
@mergify
Copy link
Contributor

mergify bot commented Sep 29, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: b5b9dcb
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@mergify mergify bot merged commit 140892a into master Sep 29, 2021
@mergify mergify bot deleted the fix-healthcheck-interval-error branch September 29, 2021 11:54
@mergify
Copy link
Contributor

mergify bot commented Sep 29, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
…ncer.configureHealthCheck()` (aws#16445)

## Summary

The [`NetworkLoadBalancer`'s](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-elasticloadbalancingv2.NetworkLoadBalancer.html) [`configureHealthCheck()`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-elasticloadbalancingv2.ApplicationTargetGroup.html#configurewbrhealthwbrcheckhealthcheck) method is incorrectly throwing a validation error when provided a valid `protocol` and the same value for both `interval` and `timeout`. 

```sh
Error: Healthcheck interval 10 seconds must be greater than the timeout 10 seconds
```

This rule only applies to Application Load Balancers and not Network Load Balancers.

This PR:

- Moves the mentioned validation logic from the `BaseTargetGroup` class to the `ApplicationTargetGroup` class.
- Adds tests that check a validation error is thrown when **invalid** `protocol`, `interval`, `timeout`, & `path` combinations are provided for the respected TargetGroup type.
- Adds tests that check a validation error is **not** thrown when **valid** `protocol`, `interval`, `timeout`, & `path` combinations are provided for the respected TargetGroup type.

Provides fix for SIM ticket: V427669955
Fixes issue: aws#16446

Refs:
- [The mentioned validation logic was implemented by this PR.](aws#16107)
- [CreateTargetGroup CloudFormation docs](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html)
- [Application Load Balancer's Health check configuration docs](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/target-group-health-checks.html)
- [Network Load Balancer's Health check configuration docs](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/target-group-health-checks.html)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-elasticloadbalancingv2 Related to Amazon Elastic Load Balancing V2 contribution/core This is a PR that came from AWS. p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(elasticloadbalancingv2): Incorrect validation on NetworkLoadBalancer.configureHealthCheck()
3 participants