通过 terraform 创建 Azure App 服务时抛出错误 An argument named "zone_redundant" is not expected here

While creating Azure App service via terraform throwing an error An argument named "zone_redundant" is not expected here

我正在尝试创建一个区域冗余 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 提供商版本 2.46.0

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

请更新代码中的 Terraform azurerm 提供商版本:

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