azurerm_resource_group_template_deployment忽略参数文件 [英] azurerm_resource_group_template_deployment ignoring parameter file

查看:103
本文介绍了azurerm_resource_group_template_deployment忽略参数文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Terraform和嵌入式ARM模板来允许在Azure中创建一个简单的逻辑应用程序.我在terraform中有如下资源块:

I am attempting to use terraform and embedded ARM templates to permit creating a simple logic app in Azure. I have the resource block in terraform as:

resource "azurerm_resource_group_template_deployment" "templateTEST" {
  name                = "arm-Deployment"
  resource_group_name = azurerm_resource_group.rg.name
  deployment_mode     = "Incremental" 
  template_content    = file("${path.module}/arm/createLogicAppsTEST.json")
  parameters_content = jsonencode({ 
    logic_app_name = { value = "logic-${var.prefix}" }
  })

}

定义了

createLogicAppsTEST.json 文件(只是前几行)

and the createLogicAppsTEST.json file is defined (just the top few lines as)

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "logic_app_name": {
            "defaultValue": "tsa-logic-dgtlbi-stage-001",
            "type": "string"
        }
    },
    "variables": {},
    "resources": [
        {
....

首次部署和运行时,即使用terraform和嵌入式ARM模板创建逻辑应用程序资源,它将在给定以下条件的情况下正确传递名称:

When deploying and running the first time, ie. creating the logic app resource using terraform and the embedded ARM template, it will create passing the name correctly given the:

  parameters_content = jsonencode({ 
    logic_app_name = { value = "logic-${var.prefix}" }
  })

但是,如果我再次运行,terraform似乎会忽略我传递的参数,并且会使用ARM模板中的默认值:

however, if I ever run again, terraform appears to ignore the parameters I am passing and goes with the default from the ARM template as:

    "logic_app_name": {
        "defaultValue": "tsa-logic-dgtlbi-stage-001",
        "type": "string"
    }

我已经更新到terraform(0.14.2)和azurerm(2.40.0)的最新版本,但是问题仍然存在.目前,由于给我的公司不同的层级,这种使Terraform在ARM上出现问题的方法,即我公司的dev,test和prod具有不同的前缀和名称.prod-,dev-.

I have updated to the latest version of both terraform (0.14.2) and azurerm (2.40.0), yet the issue persists. At present, this kind of makes ARM in terraform problematic given different tiers, dev, test and prod at my company have different prefixes and names ie. prod-, dev-.

是否有设置使terraform实际使用我通过azurerm_resource_group_template_deployment资源块传递的参数?

Is there a setting to make terraform actually use the parameters I am passing with azurerm_resource_group_template_deployment resource block?

推荐答案

我选择只使用旧的提供程序,实际上在github上有关于同一问题的公开错误报告

I elected to just use the old provider, there is actually an open bug report about this same issue on github

这篇关于azurerm_resource_group_template_deployment忽略参数文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆