小编Tal*_*ais的帖子

使用 Terraform 在 AWS 上使用网络负载均衡器 (NLB) 创建 AutoScaling 组时出现问题

我正在尝试使用 Terraform v0.11.0 创建 na NLB(我的应用程序不使用 HTTP,所以我不能使用 ALB)。查看 Hashcorp 文档,我可以创建以下代码:

resource "aws_lb" "lb" {
  name = "test"
  internal = false
  enable_deletion_protection = true
  load_balancer_type = "network"
  ip_address_type = "ipv4"
  subnet_mapping {
    subnet_id = "${data.aws_subnet.sn-app-1.id}"
    allocation_id = "${aws_eip.eip-1.id}"
  }
  subnet_mapping {
    subnet_id = "${data.aws_subnet.sn-app-2.id}"
    allocation_id = "${aws_eip.eip-2.id}"
  }
}

resource "aws_lb_target_group" "lbtg" {
  name     = "test"
  port     = "8080"
  protocol = "TCP"
  vpc_id   = "${data.aws_vpc.vpc.id}"
  deregistration_delay = "300"
  health_check {
    interval = "300"
    port = "8080"
    protocol = "TCP"
    timeout = …
Run Code Online (Sandbox Code Playgroud)

load-balancing amazon-web-services terraform

3
推荐指数
1
解决办法
4330
查看次数