【发布时间】:2020-07-07 20:57:56
【问题描述】:
所以我有一个 ecs-task-definition,我想向容器中的 hosts 文件添加一个值。这可以使用 extraHosts 块来完成:
extraHosts: A list of hostnames and IP address mappings to append to the /etc/hosts file on the container list(string)
请参阅here 了解更多信息。
我试图让这个 extraHosts 块在上面链接的 terraform-aws-ecs-task-definition 模块中运行。我的块看起来像这样:
extraHosts = [
{
"ipAddress": "x.x.x.x",
"hostname": "mongo1"
},
{
"ipAddress": "x.x.x.x",
"hostname": "mongo2"
},
]
但是这个语法让我明白了:
The given value is not suitable for child module variable "extraHosts" defined
at
.terraform/modules/ecs-task-definition/terraform-aws-ecs-task-definition-2.0.1/variables.tf:66,1-22:
element 0: string required.
过去是否有人将 extraHosts 块用于他们的 IaC?能否请教一下正确的语法?
【问题讨论】:
标签: amazon-web-services terraform amazon-ecs terraform-provider-aws