首页 > 解决方案 > 可以对通过 terraformer 生成的文件运行 terraform 命令

问题描述

我有通过 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-serviceskubernetesamazon-ec2terraformterraform-provider-aws

解决方案


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


推荐阅读