-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
r/lb_target_group: fix compatibility with Network Load Balancers #2251
Conversation
@DaveBlooman ah thanks for pointing that out, I rebased and should be fixed now |
We had some failing tests due to a typo, I patched that in c93f98a |
@catsby LGTM |
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.
Just two, rather lower prio comments.
Otherwise LGTM - thanks @DaveBlooman for the original PR.
params.Matcher = &elbv2.Matcher{ | ||
HttpCode: aws.String(healthCheck["matcher"].(string)), | ||
|
||
if *params.Protocol != "TCP" { |
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.
I think it would be a bit more future-proof and cleaner if we checked each argument separately regardless of the protocol. That said it would probably require removing all defaults from these fields and making them computed, which introduces some other potential troubles during updates.
The downside of the current solution is that we're silently ignoring certain arguments without ever telling the user which may backfire if AWS decides to support any of these arguments in the future.
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.
Agreed this isn't ideal, but I'm going to go forward as is. Part of me wonders if the real solution would have been to keep ALB and LB as separate resources entirely 🤔
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.
Agreed on that point, It is a shame to make a breaking change, but as more specific features are added to each type, they will diverge more. Let's see what aws do at re: invent
aws/resource_aws_lb_target_group.go
Outdated
if *targetGroup.Protocol != "TCP" { | ||
healthCheck["path"] = *targetGroup.HealthCheckPath | ||
healthCheck["matcher"] = *targetGroup.Matcher.HttpCode | ||
} |
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.
Nitpick, but we could do something like this
if targetGroup.HealthCheckPath != nil {
healthCheck["path"] = *targetGroup.HealthCheckPath
}
if targetGroup.Matcher.HttpCode != nil {
healthCheck["matcher"] = *targetGroup.Matcher.HttpCode
}
I know that HTTP health check arguments will never be supported for TCP LB, but it feels a little bit cleaner 😉
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.
👍 applied in 3310363
I applied feedback suggested and re-ran tests:
Going to merge this now |
@catsby - thanks for merging to master, NLB target group TCP proto. |
@dcloud9 awesome! I believe |
This is a critical blocker for our atomation. I'm unable to create a Network LB. |
@AnishAnil this was shipped yesterday in |
Today I got this error message on a deploy: After some searching I found this in the changelog: However the documentation still says it is optional and provides a default: |
The same goes for the health_check path which is also not updated in the documentation |
Thanks, didn't see that issue. |
#2380 is a follow-up PR to this |
Followup to hashicorp#2251, 1.3.0 (November 16, 2017)
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Supersedes #1884
health_check
stickiness
and Network LBsFixes #1912
Test results