aws - terraform 网关负载均衡器目标

时间:2021-02-16 19:18:11

标签: amazon-web-services terraform

我向我的目标群体声明了我的负载均衡器。

resource "aws_lb" "test" {
  load_balancer_type = "gateway"
  name               = "gwlb-test"

  subnet_mapping {
    subnet_id = aws_subnet.Security-Data-1A-subnet.id
  }
}

resource "aws_lb_target_group" "test" {
  name     = "gwlb-test"
  port     = 6081
  protocol = "GENEVE"
  vpc_id   = aws_vpc.subnet_vpc_secu.id
  target_type = "instance"


  health_check {
    port     = 80
    protocol = "HTTP"
   
  }
}

但是我找不到通过目标组添加我的两个服务器的代码。

enter image description here

我只想将我的实例添加到目标组。

非常感谢您的帮助

1 个答案:

答案 0 :(得分:0)

您正在寻找 aws_lb_target_group_attachment 资源。