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

Update NLB Health check parameters to match docs, allow NLB un/healthy counts to be different #733

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

louismollick
Copy link
Contributor

Fixes #732

I haven't tested this change ; but seems like an expected change given NLB was updated in November 2022:
https://aws.amazon.com/about-aws/whats-new/2022/11/elastic-load-balancing-capabilities-application-availability/
For example the CDK had to update their validations too:
aws/aws-cdk#26023

New values are as described in the docs:
https://docs.aws.amazon.com/elasticloadbalancing/latest/network/target-group-health-checks.html

Copy link

sonarcloud bot commented Jan 2, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@@ -261,57 +261,6 @@ def set_new_resource_outputs(self, output_definition):
return value


def validate_tcp_health_counts(props):
Copy link
Member

Choose a reason for hiding this comment

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

Why are we removing this function? Is it totally unused and I should have deleted it long time ago?

Copy link
Contributor Author

@louismollick louismollick Jan 2, 2024

Choose a reason for hiding this comment

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

https://github.com/compose-x/ecs_composex/blob/main/ecs_composex/elbv2/elbv2_ecs.py#L312

validate_tcp_health_counts is only ever used inside function fix_nlb_settings which we're also removing below (cuz NLB doesn't need those NLB-specific validations for its Healthcheck params)

Copy link
Member

Choose a reason for hiding this comment

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

Have you tried then to have HealthCheckIntervalSeconds set 6 or 7 then and did it work? (by work, I mean successful deployment to AWS via CFN)
The point of these validations / fix functions is to catch incorrect input and correct it with best effort.

I must have missed that news on the change of health check possible for NLBs/ALBs.

Copy link
Member

Choose a reason for hiding this comment

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

@louismollick any insignts on this? did you try creating the NLB with invalid interval values for example? if so, what happened?
thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JohnPreston Hey! Sorry for the radio silence, I got sidetracked

I edited and deployed the nginx example from your repo to show the NLB values:
main...louismollick:ecs_composex:elbv2ParamsFixDemo

healthcheck: 80:TCP:2:10:300:120

^^ here the HealthCheckIntervalSeconds is 300 and HealthCheckTimeoutSeconds is 120

I deployed from this branch using poetry run ecs-compose-x up -f docker-compose.yaml -f aws-compose-x.yaml -n testNLB

Below are some screenshots from the results in AWS, it even shows these values when you go to edit them in Target Group healthcheck settings:
Screen Shot 2024-01-18 at 11 40 09 PM
Screen Shot 2024-01-18 at 11 40 21 PM

Also attached the template here:
template.json

Copy link
Member

Choose a reason for hiding this comment

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

Thanks so much. There I thought I was keeping up with all the changes getting the announcement news but there we go, that's some nice changes AWS did!

Thanks @louismollick

@JohnPreston JohnPreston merged commit f7fc424 into compose-x:main Jan 19, 2024
3 of 4 checks passed
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.

elbv2 validation HealthCheckTimeoutSeconds and HealthCheckIntervalSeconds might be incorrect?
2 participants