-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
provider/aws: Add support for Network Loadbalancers #1629
Conversation
I like this approach. |
d69a044
to
5505a60
Compare
ALB -> LB Rename:
|
ALB Target Group -> LB Target Group Rename:
|
ALB Target Group -> LB Target Group Rename:
I believe the cert issues are nothing to do with this PR |
ALB Datasource -> LB Datasource Rename:
Again, I believe the certs are nothing to do with this PR |
DataSource Backwards compatibility tests - i.e. using aws_alb rather than aws_lb ALB:
ALB Listener:
ALB Target Group:
|
Resource Backwards compatibility tests - i.e using aws_alb rather than aws_lb ALB:
ALB Listener:
ALB Listener Rule:
ALB Target Group:
ALB Target Group Attachment:
|
86dab53
to
a253a4b
Compare
4bd990e
to
8be9043
Compare
And finally.... Support for NLBs themselves:
|
@catsby / @radeksimko / @tombuildsstuff I really think this needs to be part of 1.0.0 as this is a potentially B/C due to the renaming - I have tried to cover all of the test cases as above but there may be 1 or 2 very small edge cases that I missed |
I also like this approach, when can we have this merged? |
Hi @stack72, Seems awesome though! 👍 |
@Ninir this is only as it's going to be a controversial change :( |
No worries! 😄 |
Can we get an idea when this will be merged and released? |
Hi all! I apologize for the very delayed response here. We've taken a look and thus far are pretty confident there are little or no backwards incompatible or otherwise breaking changes here. Because we didn't see any BC or problems, we didn't include it in the
Thanks for the patience, and thanks for all the work here, @stack72 ! |
I think this line needs to be changed to allow Target Groups with the protocol TCP: https://github.com/terraform-providers/terraform-provider-aws/pull/1629/files#diff-375aea487c27a6ada86edfd817ba2401R423 Based on the AWS docs here: http://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html I think Network Load Balancers only support Target Groups with protocol TCP. |
I think releases should be often and small. Having the tip of master available is potentially a faster way of getting feedback as people won't have to compile themselves. |
@DaveBlooman while this probably isn't the right place for the discussion, in the words of Kelsey hightower it would be dope if they released a version automatically after every merge, following the rules of semantic versioning. A guy can dream, eh? |
We have adopted 1.0.0 of the AWS terraform provider, but also pulled in a PR adding support for NLB, which appears to be targeting a 1.0.1 release. (see hashicorp/terraform-provider-aws#1629) Naming is a little strange on these load balancers due to confusing decisions by both AWS and Terraform. For our modules mapped on top - we use: * `elasticloadbalancing` module supports ELB * `elasticloadbalancingv2` module supports ALB and NLB * `applicationloadbalancing` module supports ALB CloudFormation uses the first two names. Terraform uses an `elb` prefix for the first, an `lb` prefix for the second and an `alb` prefix for the third. They have effectively deprecated the third as part of the addition of the second group (in fact, those are just aliases now I believe).
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.
@stack72 This is looking pretty good - thanks for all the work, esp. for updating the name across the whole codebase.
I left you one semi-important question + a few nitpicks, but overall I'm pretty much ready to merge this once you resolve conflicts.
aws/resource_aws_lb.go
Outdated
@@ -295,7 +354,8 @@ func resourceAwsAlbUpdate(d *schema.ResourceData, meta interface{}) error { | |||
}) | |||
} | |||
|
|||
if d.HasChange("idle_timeout") { | |||
// It's important to know that Idle timeout is not supported for Network Loadbalancers | |||
if d.Get("load_balancer_type").(string) != "network" && d.HasChange("idle_timeout") { |
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.
Shouldn't we instead error out here and let the user know they made a mistake instead of silently ignoring it?
website/docs/d/lb.html.markdown
Outdated
|
||
Provides information about an Application Load Balancer. | ||
~> **Note:** `aws_alb` is know as `aws_lb`. The functionality is identical. |
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.
Small typo - know_n_
|
||
# aws_lb_listener | ||
|
||
~> **Note:** `aws_alb_listener` is know as `aws_lb_listener`. The functionality is identical. |
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 - typo
|
||
# aws_lb_target_group | ||
|
||
~> **Note:** `aws_alb_target_group` is know as `aws_lb_target_group`. The functionality is identical. |
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 - typo
## Argument Reference | ||
## Argument Reference | ||
## Argument Reference | ||
## Argument Reference |
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 I guess this header duplication wasn't intentional?
Provides an Application Load Balancer Listener resource. | ||
Provides a Load Balancer Listener resource. | ||
|
||
~> **Note:** `aws_alb_listener` is know as `aws_lb_listener`. The functionality is identical. |
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 - typo
target group | ||
|
||
~> **Note:** `aws_alb_target_group_attachment` is know as `aws_lb_target_group_attachment`. The functionality is identical. |
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 - typo
sorry @radeksimko, I accidentally closed this PR - with a branch delete. I just repushed the same code to a new PR #1806 When you are happy it's the same, I will make all of the changes you asked for P. |
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! |
Fixes: #1618
In terraform, we had the idea of an alb. In AWS this doesn't exist. ALBs
are actually Load balancers of type
application
Therefore, the first part of this PR adds a new parameter to ALBs called
load_balancer_type
. We default this toapplication
to follow thesame idea as the current behaviour
The next part of the PR will then change the idea of an alb -> lb
In order to preserve backwards compatibility, we have added another
resource name to the same schema type. This means we effectively have an
alias of aws_alb and aws_lb. This includes updating all of the tests
to make sure and remove the idea of ALB and rename to LB and then we
will add a check to make sure we can still check that an ALB can be
created in the old resource