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): target group health check does not validate interval versus timeout #16107

Merged
merged 8 commits into from
Aug 27, 2021

Conversation

mprencipe
Copy link
Contributor

fix: Add validation to target group health check creation. Fixes issue #3703.


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 Aug 18, 2021

@peterwoodworth peterwoodworth added @aws-cdk/aws-elasticloadbalancingv2 Related to Amazon Elastic Load Balancing V2 effort/small Small work item – less than a day of effort p2 labels Aug 19, 2021
@njlynch njlynch changed the title fix: Add validation to target group health check creation. Fixes issue #3703. fix(elasticloadbalancingv2): target group health check does not validate interval versus timeout Aug 27, 2021
Copy link
Contributor

@njlynch njlynch left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@mergify
Copy link
Contributor

mergify bot commented Aug 27, 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: 3aaf7d7
  • 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 a85ad39 into aws:master Aug 27, 2021
@mergify
Copy link
Contributor

mergify bot commented Aug 27, 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 Sep 6, 2021
…ate interval versus timeout (aws#16107)

fix: Add validation to target group health check creation. Fixes issue aws#3703.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@akash1810
Copy link
Contributor

This change is great! We were recently caught out by this behaviour and made a similar patch (guardian/cdk#762).

I wonder if it also makes sense to perform this validation in the constructor too to fail fast? Happy to raise a PR to this effect if it makes sense.

david-doyle-as24 pushed a commit to david-doyle-as24/aws-cdk that referenced this pull request Sep 7, 2021
…ate interval versus timeout (aws#16107)

fix: Add validation to target group health check creation. Fixes issue aws#3703.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mergify bot pushed a commit that referenced this pull request Sep 29, 2021
…ncer.configureHealthCheck()` (#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: #16446

Refs:
- [The mentioned validation logic was implemented by this PR.](#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*
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 effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants