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

aws_lb_target_group requires HTTP or HTTPS #2668

Closed
jasonkuehl opened this issue Dec 14, 2017 · 8 comments
Closed

aws_lb_target_group requires HTTP or HTTPS #2668

jasonkuehl opened this issue Dec 14, 2017 · 8 comments

Comments

@jasonkuehl
Copy link

It would appear that when you cant specify anything other then HTTP or HTTPS on a protocol in a target group. This is an issue when you try and create TCP Load Balancers.

Error: aws_lb_target_group.testexternal: "protocol" must be either "HTTP" or "HTTPS"

Terraform v0.11.1

Example Code

resource "aws_lb" "testexternal" {
  name                        = "testserver"

  load_balancer_type          = "network"
  internal                    = false
  subnets                     = ["${module.subnet.ELB-subnet-ids}"]
  enable_deletion_protection  = true
}

resource "aws_lb_target_group" "testexternal" {
  name     = "testexternal"
  protocol = "TCP"
  port     = 22
  vpc_id      = "${aws_vpc.bla.id}"

  health_check {
      healthy_threshold   = 10
      unhealthy_threshold = 2
      interval            = 10
      timeout             = 3
  }
}

resource "aws_lb" "testexternal" {
  name                        = "testserver"

  load_balancer_type          = "network"
  internal                    = false
  subnets                     = ["${module.subnet.ELB-subnet-ids}"]
  enable_deletion_protection  = 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_attachment" "testexternal" {
  target_group_arn = "${aws_lb_target_group.testexternal.arn}"
  target_id        = "${aws_instance.testserver-001.id}"
  port             = 22
}
@Techcadia
Copy link

#1838 Looks like it was solved might be that your running an older version of the provider?

@jasonkuehl
Copy link
Author

@Techcadia

Thanks for the link, I just check my providers and I see I'm using 0.11.1

terraform {
  required_version = "0.11.1"

@Techcadia
Copy link

@jasonkuehl Can you check the version your are currently running of the provider.

you can run terraform init and it should give you the provider version its currently using.

For example

* provider.aws: version = "~> 1.0"

I have an assumption you might be running a older version like 1.0.0 and not the newest version 1.6.0

@jasonkuehl
Copy link
Author

@Techcadia Its showing

provider.aws: version = “~> 1.5”

Does my issue go away in 1.6?

@jasonkuehl
Copy link
Author

@jasonkuehl
Copy link
Author

It looks like my TCP issue was fixed in 1.6 however I have a new issues in this ticket

#2708

This ticket can be closed.

@TechIsCool
Copy link

@jasonkuehl since your the creator you can close the ticket.

@ghost
Copy link

ghost commented Apr 10, 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 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants