简体   繁体   English

如何在使用 Terraform 创建时将 Health Probe id 添加到 LB 规则

[英]How to add Health Probe id TO LB Rule while creating using Terraform

I am trying to add a LB Rule using Terraform but unable to find a way to refer existing probe id ( Health Probe).我正在尝试使用 Terraform 添加 LB 规则,但无法找到引用现有探测器 ID (Health Probe) 的方法。 Below is my code.下面是我的代码。

resource "azurerm_lb_rule" "lb-rules" {
  resource_group_name            = var.lb_rg
  loadbalancer_id                = data.azurerm_lb.lb.id
  name                           = var.LB_Rule_Name
  protocol                       = var.protocol
  frontend_port                  = var.frontend_port
  backend_port                   = var.backend_port
  frontend_ip_configuration_name = var.frontend_ip_configuration_name
  backend_address_pool_ids = [data.azurerm_lb_backend_address_pool.backend.id]
 }

From azurerm provider docs :来自azurerm 提供者文档

The following arguments are supported:支持以下 arguments:

... ...

probe_id - (Optional) A reference to a Probe used by this Load Balancing Rule. probe_id -(可选)对此负载平衡规则使用的探测器的引用。

Therefore:所以:

resource "azurerm_lb_rule" "lb-rules" {
    [...]
    probe_id = azurerm_lb_probe.your_probe.id
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 terraform aws_lb_listener_rule 条件争论未在 terraform 0.12.20 中得到认可 - terraform aws_lb_listener_rule condition arguement not getting recognized in terraform 0.12.20 使用 terraform 创建 aks 集群时出现 Hashicorp 提供程序错误 - Getting Hashicorp Provider Error while creating aks cluster using terraform Terraform 创建原则时出错 - Terraform error while creating principles Terraform 配置LB属性失败 - Terraform Failure configuring LB attributes 为 alb 侦听器规则创建动态 Terraform 规则时出错 - Error when creating dynamic terraform rule for alb listener rule 如何在通过 gcloud 创建出口规则时包含 IP 列表? - how to include list of IPs while creating egress rule via gcloud? Google Cloud Run Liveness Probe with Terraform - Google Cloud Run Liveness Probe with Terraform 如何使用 terraform 将多个机密添加到 azure 密钥保管库 - How to add multiple secrets to azure key vault using terraform 如何使用 gcloud 在实例组上添加健康检查? - How do you add health checks on instance-groups using gcloud? 如何使用 Terraform 获取新创建的实例 ID - How to get newly created instance id using Terraform
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM