-1

当我打电话时terraform destroy,对于所使用的任何提供程序,我都会收到与下一个类似的错误。

Error: fork/exec /home/shura/code/devops/terragrunt/aws/eci-sandbox/eu-west-1/ops/dummy/.terragrunt-cache/J-_sukmO5D-z2WncfrbXY8hafRo/FQ4q4AgnhaqBBwSZgGy_ql6eP1Y/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.47.0_x4 : permission denied

直接使用 terraform 或通过 terragrunt 使用没有区别。

我可以注释掉代码中的所有资源,然后再注释掉terraform apply。它会破坏所有资源没问题。

4

1 回答 1

0

Turn out that the issue is related to configuration. I use Ubuntu 18.04 running inside VirtualBox to execute all commands, but the source code is stored on host Win10 and mounted into VM via shared folders. If I would move terraform and terragrunt caches out of the mounted file system, then everything starts to work.

effectively:

# tell terraform to use linux fs
echo 'plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"' > ~/.terraformrc
# tell terragrunt to use linux fs
export TERRAGRUNT_DOWNLOAD=$HOME/.terragrunt.d

I would still be very much interested to hear what is the root cause. How use of mounted fs breaks providers?

于 2020-02-03T11:23:36.867 回答