Linux Terraform-无法在本地exec中运行多个命令

Linux Terraform-无法在本地exec中运行多个命令,linux,amazon-web-services,terraform,terraform-provider-aws,Linux,Amazon Web Services,Terraform,Terraform Provider Aws,我对地形世界还不熟悉。我正在尝试使用Terraform运行shell脚本 下面是main.tf文件 #Executing shell script via Null Resource resource "null_resource" "install_istio" { provisioner "local-exec" { command = <<EOT "chmod +x install-i

我对地形世界还不熟悉。我正在尝试使用Terraform运行shell脚本

下面是main.tf文件

#Executing shell script via Null Resource

resource "null_resource" "install_istio" {
 provisioner "local-exec" {
    command = <<EOT
      "chmod +x install-istio.sh"
      "./install-istio.sh"
    EOT
    interpreter = ["/bin/bash", "-c"]
    working_dir = "${path.module}"
  }
}
我得到以下警告:

Warning: Interpolation-only expressions are deprecated
  on .terraform/modules/istio_module/Istio-Operator/main.tf line 10, in resource "null_resource" "install_istio":
  10:     working_dir = "${path.module}"
Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.
Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.
上面main.tf中的脚本在后台运行命令

有人能帮我补缺的部分吗?如何使用本地exec运行多个命令?如何消除警告消息


谢谢你的帮助,谢谢

我认为这里发生的两件事实际上并不相关

这里的主要问题是如何编写
localexec
脚本:

    command = <<EOT
      "chmod +x install-istio.sh"
      "./install-istio.sh"
    EOT
通过将第一个命令行放在引号中,您告诉shell尝试运行一个名为
chmod+x install istio.sh的程序,而不带任何参数。也就是说,shell将尝试在
路径
中找到名为
chmod+x install istio.sh
的可执行文件,而不是像我想的那样尝试运行名为
chmod
的命令,并使用一些参数

删除命令行周围的引号以使其生效。此处不需要引号,因为这两个命令都不包含任何需要引号的特殊字符:

    command = <<-EOT
      chmod +x install-istio.sh
      ./install-istio.sh
    EOT

要消除警告,只需从
working\u dir=“${path.module}”
中删除
“${
}”
,即
working\u dir=path.module
。是下一个问题,您是说没有执行
install istio.sh
?是否有任何错误消息?您是否碰巧使用了GKE?非常感谢Martin的回复和知识分享
"chmod +x install-istio.sh"
"./install-istio.sh"
    command = <<-EOT
      chmod +x install-istio.sh
      ./install-istio.sh
    EOT
    working_dir = path.module