【问题标题】:terraform destroy - access deniedterraform destroy - 访问被拒绝
【发布时间】:2020-05-19 03:18:04
【问题描述】:

当我调用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。它会破坏所有资源没问题。

【问题讨论】:

    标签: terraform terragrunt


    【解决方案1】:

    原来问题与配置有关。 我使用在 VirtualBox 中运行的 Ubuntu 18.04 来执行所有命令,但源代码存储在主机 Win10 上并通过共享文件夹安装到 VM 中。 如果我将 terraform 和 terragrunt 缓存移出已挂载的文件系统,那么一切都会开始工作。

    有效地:

    # 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
    

    我仍然很想知道根本原因是什么。使用挂载的 fs 如何破坏提供程序?

    【讨论】:

      猜你喜欢
      • 2021-01-31
      • 2022-08-10
      • 2021-10-14
      • 2019-11-28
      • 2020-04-01
      • 2018-09-23
      • 2021-05-19
      • 1970-01-01
      • 2014-08-10
      相关资源
      最近更新 更多