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

Support for network load balancer #1618

Closed
robinbowes opened this issue Sep 7, 2017 · 19 comments · Fixed by #1806
Closed

Support for network load balancer #1618

robinbowes opened this issue Sep 7, 2017 · 19 comments · Fixed by #1806
Labels
enhancement Requests to existing resources that expand the functionality or scope.

Comments

@robinbowes
Copy link

AWS recently announced a new load balancer: the network load balancer

https://aws.amazon.com/blogs/aws/new-network-load-balancer-effortless-scaling-to-millions-of-requests-per-second/

Would be good to get support for this into this provider

@karnauskas
Copy link

👍

@aakash-garg-olx
Copy link

+1

@bentterp
Copy link

bentterp commented Sep 8, 2017

The ability to build a load-balancer from a number of EIP's is particularly interesting for services where moving to another IP-address causes huge operational headaches.

@et304383
Copy link

et304383 commented Sep 8, 2017

I had a feeling this was going to be requested right away.

NLB is amazing for supporting a static IP load balanced layer. Definitely looking forward to terraform support.

@enderv
Copy link

enderv commented Sep 9, 2017

Reading over the docs looks like pretty much all the ALB stuff can be copied over and just renamed. Only need to add support for EIP and change the protocol options to TCP only on the target group. I will try to take a stab at this over the weekend but I have no idea how far I will make it.

@robinbowes
Copy link
Author

I wondered whether this might be the case.

I also wondered whether it might be an idea to support both types with one code base, ie. have a type field to choose between alb and nlb?

@enderv
Copy link

enderv commented Sep 9, 2017

I thought about that as well, but I think if we go that route would have to rename all the alb resources to something more generic and I'm not sure on the policy of breaking changes. I am in favor of just creating new resource type for nlb just in case they diverge more in the future but thats just my thoughts.

@robinbowes
Copy link
Author

BTW @stack72 recently tweeted that he was looking at this.

@bubunyo
Copy link

bubunyo commented Sep 11, 2017

+1

@Ninir Ninir added the enhancement Requests to existing resources that expand the functionality or scope. label Sep 18, 2017
stack72 added a commit to stack72/terraform-provider-aws that referenced this issue Oct 4, 2017
Fixes: hashicorp#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 to `application` to follow the
same 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
@kcormier
Copy link

kcormier commented Oct 4, 2017

Excited to see this merged! Do we have an estimate of when a new release will be cut?

@benmenlo
Copy link

+++1 Looking to leverage nlb for multiple service offerings and this issue is blocking the adoption of terraform.

@bentterp
Copy link

@ben-ms But it's not blocking anymore, it's merged and released.

@robinbowes
Copy link
Author

@bacoboy
Copy link

bacoboy commented Oct 25, 2017

While merged, I believe there are still issues in #1838.
Somebody seems to be working on a ton of fixes in #1948 so I am patiently watching those 2 items. Cheers

@robomon1
Copy link

robomon1 commented Dec 6, 2017

The online documentation doesn't mention it anywhere as far as I could find. It would also be nice if the documentation showed what version a new feature like this was added so that we can determine whether or not we need to upgrade.

@gordonbondon
Copy link
Contributor

It will be really useful to have something like added in 1.2.0 in parameter or resource docs. Something like ansible has in modules, for example here http://docs.ansible.com/ansible/latest/archive_module.html

@benmenlo
Copy link

benmenlo commented Dec 6, 2017

@robomon1 It's here:

https://www.terraform.io/docs/providers/aws/r/lb.html

With "load_balancer_type" = "network" or "application". I was able to get this working. The listeners must support HTTP(s).

@luis-silva
Copy link

A basic example of a working tcp NLB, in case someone stumbles upon this thread:

resource "aws_lb" "testexternal" {
  name = "testLB"

  load_balancer_type               = "network"
  internal                         = false
  subnets                          = ["subnet-x", "subnet-y", "subnet-z"]
  enable_cross_zone_load_balancing = true
}

resource "aws_lb_listener" "testexternal" {
  load_balancer_arn = "${aws_lb.testexternal.arn}"
  protocol          = "TCP"
  port              = "22"


  default_action {
    target_group_arn = "${aws_lb_target_group.testexternal.arn}"
    type             = "forward"
  }
}


resource "aws_lb_target_group" "testexternal" {
  name     = "testexternal"
  protocol = "TCP"
  port     = 22
  vpc_id   = "vpc-w"


  health_check {
    healthy_threshold   = 3
    unhealthy_threshold = 3
    interval            = 10
    port                = 22
    protocol            = "TCP"
  }
}


resource "aws_lb_target_group_attachment" "testexternal" {
  target_group_arn = "${aws_lb_target_group.testexternal.arn}"
  target_id        = "i-12345678"
  port             = 22
}

@ghost
Copy link

ghost commented Apr 3, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope.
Projects
None yet