浏览量 3443
2021/02/10 09:35
MAC安装Terraform
Brew安装
-
安装 Command Line Tools for Xcode 12.5 beta 下载地址: https://developer.apple.com/download/more/
-
安装 Brew 终端执行
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Asdf安装
- brew install coreutils curl git
- brew install asdf
Terraform安装
- asdf plugin add terraform
- asdf install terraform 0.14.4
- asdf install terraform 0.12.26
Terraform使用
-
设置asdf global
asdf global terraform 0.14.4 asdf current terraform 0.14.4
-
使用terraform
asdf exec terraform
-
添加 zsh配置文件
cat ~/.zshrc . /usr/local/opt/asdf/asdf.sh
-
直接执行terraform
terraform version Terraform v0.14.4
- 切换版本
zi.wang@ziwangdeMacBook-Pro ~ % asdf current terraform 0.14.4 /Users/zi.wang/.tool-versions zi.wang@ziwangdeMacBook-Pro ~ % asdf global terraform 0.12.26 zi.wang@ziwangdeMacBook-Pro ~ % asdf current terraform 0.12.26 /Users/zi.wang/.tool-versions