我有一个 json 文件,其中定义了 stepfunction 状态机,然后在我想使用的 terraform 中templatefiile()
,当前文件夹结构是:
terraform folder -> terraform file (e.g: step-function.tf file) & json file (e.g: step-function.json)
在 step-function.tf 文件中:
definition = templatefile("step-function.json",
{
xxxxxxx
}
)
这会给我错误:
Invalid value for "path" parameter: no file exists at
step-function.json; this function works only with files
that are distributed as part of the configuration source code, so if this file
will be created by a resource in this configuration you must instead obtain
this result from an attribute of that resource.
我不完全明白为什么,我该如何修改这个路径,当我在本地测试这个 terraform 脚本时,如果我使用templatefile("../../xxx/xxx/terraform/step-function,json")
它会工作,但我不想使用这个表达式,我该如何修改它?非常感谢。