如何安装指定的Terraform版本并进一步使用它



如果我通过brew install terraform@0.12安装Terraform,它安装了最新版本的0.12.31

然后为了使用它,我运行命令alias terraform=$(brew config | awk '/HOMEBREW_PREFIX:/ { print $2 }')/opt/terraform@0.12/bin/terraform

但我不需要使用最新版本,我想使用0.12.29

我可以通过安装

brew install tfenv
tfenv install 0.12.29
tfenv use 0.12.29

但是我不知道如何在alias terraform=中指定这个版本(0.12.29(。

你听说过这个项目吗?https://tfswitch.warrensbox.com/Quick-Start/它使调整当前版本的地形更加容易。

terragrunt也是如此https://warrensbox.github.io/tgswitch/additional.html

最新更新