terraform 创建 AKS 使用现有的应用程序网关似乎已损坏
我很确定最近有变化吗?似乎我不能再在 terraform 中使用现有的应用程序网关作为 aks 的 AGIC,
ingress_application_gateway {
subnet_id = var.ingress_agic_subnet == null ? null : data.azurerm_subnet.ingress_agic_subnet[0].id # existing subnet where I created App gateway
gateway_id = var.ingress_application_gateway_id #existing app gateway ID
}
错误消息一直显示
│ Error: Conflicting configuration arguments
│
│ with module.aks.azurerm_kubernetes_cluster.this,
│ on terraform-azurerm-lab3-aks\main.tf line 70, in resource "azurerm_kubernetes_cluster" "this":
│ 70: subnet_id = var.ingress_agic_subnet == null ? null : data.azurerm_subnet.ingress_agic_subnet[0].id
│
│ "ingress_application_gateway.0.subnet_id": conflicts with ingress_application_gateway.0.gateway_id
╵
╷
│ Error: Conflicting configuration arguments
│
│ with module.aks.azurerm_kubernetes_cluster.this,
│ on terraform-azurerm-lab3-aks\main.tf line 73, in resource "azurerm_kubernetes_cluster" "this":
│ 73: gateway_id = var.ingress_application_gateway_id
│
│ "ingress_application_gateway.0.gateway_id": conflicts with ingress_application_gateway.0.subnet_id
I'm pretty sure there's a recent change? seems I can't use existing app gateway as AGIC for aks anymore in terraform
ingress_application_gateway {
subnet_id = var.ingress_agic_subnet == null ? null : data.azurerm_subnet.ingress_agic_subnet[0].id # existing subnet where I created App gateway
gateway_id = var.ingress_application_gateway_id #existing app gateway ID
}
the error message keeps saying
│ Error: Conflicting configuration arguments
│
│ with module.aks.azurerm_kubernetes_cluster.this,
│ on terraform-azurerm-lab3-aks\main.tf line 70, in resource "azurerm_kubernetes_cluster" "this":
│ 70: subnet_id = var.ingress_agic_subnet == null ? null : data.azurerm_subnet.ingress_agic_subnet[0].id
│
│ "ingress_application_gateway.0.subnet_id": conflicts with ingress_application_gateway.0.gateway_id
╵
╷
│ Error: Conflicting configuration arguments
│
│ with module.aks.azurerm_kubernetes_cluster.this,
│ on terraform-azurerm-lab3-aks\main.tf line 73, in resource "azurerm_kubernetes_cluster" "this":
│ 73: gateway_id = var.ingress_application_gateway_id
│
│ "ingress_application_gateway.0.gateway_id": conflicts with ingress_application_gateway.0.subnet_id
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢您stephybun在 GitHub 讨论中提出的建议与同一问题相关。将此作为答案发布以帮助其他社区成员。
参考:https://github.com/hashicorp/ terraform-provider-azurerm/issues/15693
即使您也可以遵循此Microsoft 文档 提到了相同的启用 AGIC现有 AKS 集群中的附加组件,您只需要
gateway_id
Thank You stephybun for your suggestion over the GitHub Disccusion related to same issue. Posting this as an asnwer to help other community member as well.
Reference : https://github.com/hashicorp/terraform-provider-azurerm/issues/15693
Even you can follow this Microsoft Documennt which mention the same Enable the AGIC add-on in existing AKS cluster you only require
gateway_id