【问题标题】:While creating Azure App service via terraform throwing an error An argument named "zone_redundant" is not expected here通过 terraform 创建 Azure App 服务时抛出错误此处不应出现名为“zone_redundant”的参数
【发布时间】:2021-11-15 00:59:05
【问题描述】:

我正在尝试创建区域冗余 Azure 应用服务以实现高可用性,但 terraform validate 引发错误此处不应出现名为“zone_redundant”的参数

我的配置如下所示

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "=2.46.0"
    }
  }
}

  resource "azurerm_app_service_plan" "example" {
  name                = "app-demo"
  location            = "Australia East"
  resource_group_name = "rg-app-service"
  kind                = "Linux"
  reserved            = true
  zone_redundant      = true

         
  sku {
    tier = "PremiumV2"
    size = "P1v2"
   capacity = "3"
  }

}

我不确定我在这里缺少什么。谁能给我建议?

参考

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/app_service_plan#zone_redundant

【问题讨论】:

  • 您使用什么版本的 terraform azurerm 提供程序?
  • @AndriyBilous - 我使用的是 2.46.0 版本
  • 你能尝试使用最新版本的 2.77.0 吗?
  • 太好了.. 谢谢@AndriyBilous。它现在可以工作了:)。只是想和你确认一下,zone_redundant = true。将在提到的位置跨区域部署 3 个实例对吗?
  • 是的,应用服务计划将在提到的位置跨区域创建

标签: azure terraform azure-web-app-service azure-app-service-envrmnt


【解决方案1】:

您正在使用 Terraform azurerm 提供程序版本 2.46.0

azurerm_app_service_plan 中的zone_redundant 选项 Terraform 资源已添加到 Terraform azurerm 提供程序版本 2.74.0 中,这就是为什么您收到错误“此处不需要名为“zone_redundant”的参数。”

请在您的代码中更新 Terraform azurerm 提供程序版本:

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "=2.74.0"
    }
  }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-27
    • 1970-01-01
    • 1970-01-01
    • 2020-12-20
    • 2021-09-05
    • 1970-01-01
    • 2022-09-29
    • 2021-01-09
    相关资源
    最近更新 更多