【问题标题】:Can run terraform commands on files generated via terraformer可以对通过 terraformer 生成的文件运行 terraform 命令
【发布时间】:2021-10-29 19:09:23
【问题描述】:

我有通过 terraformer 生成的 tf 文件,当我运行“terraform plan/refresh”时,它给了我一堆错误,例如:

    Error: Invalid combination of arguments

  on instance.tf line 400, in resource "aws_instance" "worker-node":
 400:     id   = "lt-xxxxxxxxxxxxxxx"

"launch_template.0.id": only one of
`launch_template.0.id,launch_template.0.name` can be specified, but
`launch_template.0.id,launch_template.0.name` were specified.


Error: Invalid combination of arguments

  on instance.tf line 401, in resource "aws_instance" "worker-node":
 401:     name = "eksctl-workernode"

"launch_template.0.name": only one of
`launch_template.0.id,launch_template.0.name` can be specified, but
`launch_template.0.id,launch_template.0.name` were specified.

这只是关于 EC2 的问题,对于每个其他服务,它都会给出不同的错误。导致错误的实例是 EKS 节点。

【问题讨论】:

  • 产生错误的代码是什么?
  • 如何查看错误码?

标签: amazon-web-services kubernetes amazon-ec2 terraform terraform-provider-aws


【解决方案1】:

您的启动模板变量似乎不正确。您可能有一些需要纠正的工作节点代码。您是否尝试使用EKS node groups?

【讨论】:

  • 没有。不过我解决了。显然在启动模板中有一些配置在“启动模板”下编写时会导致错误。{}所以我删除了 lauch 模板名称,只留下了 id 和 terraform plan/refresh 工作。
【解决方案2】:

来自 cmets 的社区回答:

启动模板中有配置。这导致在launch template{}下写入错误

所以我删除了launch template 名称,只留下了id

然后terraform plan/apply 工作了

【讨论】:

    猜你喜欢
    • 2019-04-16
    • 1970-01-01
    • 2018-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-05
    • 1970-01-01
    相关资源
    最近更新 更多