【发布时间】:2021-03-26 17:37:41
【问题描述】:
我的 terraform 代码中有一个 template_file 部分,它有一个变量值可以从如下文件中选取
data "template_file" "post_sql"{
template = "${file("/home/user/setup_template.yaml")}"
vars = {
name1= data.azurerm_storage_account.newazure_storage_data.name
name2="${file("/home/user/${var.newname}loca.txt")}"
}
}
此文件将在任务中间生成,但 terraform 在 apply 阶段本身的开头查找它。我什至尝试添加depends_on 无济于事并引发以下错误
Call to function "file" failed: no file exists at
/home/user/newnamerloca.txt.
我怎样才能使这项工作,任何帮助将不胜感激
【问题讨论】:
-
这方面有什么帮助吗?
标签: terraform terraform-template-file