terraform plan出现错误:函数调用(函数代码)

kkbh8khc  于 2021-06-14  发布在  ElasticSearch
关注(0)|答案(1)|浏览(522)

请查找我们正在使用的terraform脚本的gitlab repo。在此处输入链接描述run-in terraform plan为ElasticSearch的all-in-one.yaml文件提供以下错误。

Error: Error in function call
 on kubernetes.tf line 49, in locals:
 49:   resource_list = yamldecode(file("${path. module}/all-in-one.yaml")).items
   |----------------
   | path.module is "."

Call to function `"yamldecode"` failed: on line 458, column 1: unexpected extra
content after value.

在此处输入图像描述

2w3rbyxf

2w3rbyxf1#

如精细手册所述:
只允许一个yaml文档。如果给定字符串中存在多个文档,则此函数将返回错误。
你可以简单地重现你的错误信息:

content  = yamldecode("---\nhello: world\n---\ntoo: bad\n")
on main.tf line 14, in resource "local_file" "example":
  14:   content  = yamldecode("---\nhello: world\n---\ntoo: bad\n")

Call to function "yamldecode" failed: on line 2, column 1: unexpected extra
content after value.

相关问题