【发布时间】:2019-02-13 22:41:55
【问题描述】:
我使用的是 terraform 版本 0.11.8 并尝试了这个 POC https://github.com/salizzar/terraform-aws-docker 当我执行 terraform init 时,它会引发以下错误。 我是使用 terraform 的新手。谷歌搜索了很多,并尝试引用 terraform 模块注册表来摆脱这个错误,但徒劳无功。
有人可以运行此 POC 并指出需要更改的内容吗?
https://github.com/salizzar/terraform-aws-docker/blob/master/main.tf
**ERROR :**
[root@localhost test]# terraform init
There are some problems with the configuration, described below.
The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.
Error: Error loading /home/tottally/main.tf: Invalid dot index found: 'var.aws_security_group.sg_count'. Values in maps and lists can be referenced using square bracket indexing, like: 'var.mymap["key"]' or 'var.mylist[1]'. in:
${var.aws_security_group.sg_count}
【问题讨论】:
-
我在这里找到了一个参考:stackoverflow.com/questions/38375252/… 似乎 concat 函数在 terraform 中已过时,但我仍然坚持更换它
-
其中一个失败的尝试是去掉 main.tf 中的 concat 并像这样替换它 :name = "terraform_security_group_${lookup(var.aws_security_group, "sg_[count.index]_name") }"
标签: terraform