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

yandex_alb_load_balancer с двумя listener #457

Open
somewho opened this issue Jul 30, 2024 · 0 comments
Open

yandex_alb_load_balancer с двумя listener #457

somewho opened this issue Jul 30, 2024 · 0 comments

Comments

@somewho
Copy link

somewho commented Jul 30, 2024

при попытке создать конфигурацию типа

resource "yandex_alb_load_balancer" "alb_app" {
 ...
  listener {
    name = "redirect-to-https-listener"
    endpoint {
      address {
        external_ipv4_address {
        }
      }
      ports = [80]
    }
    http {
      redirects {
        http_to_https = true
      }
    }
  }

  listener {
    name = "listener-https"
    endpoint {
      address {
        external_ipv4_address {
        }
      }
      ports = [443]
    }
    tls {
      default_handler {
        http_handler {
          http_router_id = yandex_alb_http_router.alb-http-router.id
        }
        certificate_ids = [yandex_cm_certificate.le.id]
      }
    }
  }
}

происходит ошибка

│ Error: Error expanding listeners while creating ALB Load Balancer: Either external ipv4 address or internal ipv4 address or external ipv6 address should be specified for the HTTP route
│ 
│   with yandex_alb_load_balancer.alb_app,
│   on main-alb.tf line 42, in resource "yandex_alb_load_balancer" "alb_app":
│   42: resource "yandex_alb_load_balancer" "alb_app" {

а если такую конфигурацию создать через веб, то terraform apply проходит без ошибок
подозреваю, что виноват блок

 address {
        external_ipv4_address {
        }
      }

в документации нет примера конфигурации c несколькими блоками listener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant