【问题标题】:terraform - how to tag azure notification hubterraform - 如何标记 azure 通知中心
【发布时间】:2020-10-04 14:29:38
【问题描述】:

我已尝试创建 Azure 通知中心命名空间和 Azure 通知中心。

我看到官方 terraform 站点的文档,并且 tag 参数可用。 (https://www.terraform.io/docs/providers/azurerm/r/notification_hub.html#tags)

但不可能,如你所见:

resource "azurerm_notification_hub_namespace" "nothub_ns" {
  name                = "${var.nh_namespace_name}"
  resource_group_name = "${var.rgname}"
  location            = "${var.location}"
  namespace_type      = "NotificationHub"

  sku_name = "${var.sku_type}"

  tags = {
    acronimo = "${var.acronimo}"
  }

}

但我找回了这个错误:

Error: Unsupported argument

  on TemplateNotificationHub.tf line 31, in resource "azurerm_notification_hub_namespace" "nothub_ns":
  31:   tags = {

An argument named "tags" is not expected here.

地形版本
Terraform v0.12.24

Azure 提供程序版本:2.06.0

【问题讨论】:

    标签: azure terraform


    【解决方案1】:

    这似乎是 Azure 提供程序版本问题

    如果添加 Azure Provider 的 latest version2.14.0,则不会遇到此错误:“此处不应出现名为“tags”的参数”。查看changelog 了解版本信息和发行说明。

    provider "azurerm" {
      version = "=2.14.0"
      features {}
    }
    

    【讨论】:

      猜你喜欢
      • 2017-08-29
      • 2014-09-28
      • 1970-01-01
      • 2021-07-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-22
      • 1970-01-01
      相关资源
      最近更新 更多