-
-
Save harsh4870/11f4568d2e72c76515a100f9c0bb087e to your computer and use it in GitHub Desktop.
Install Terraform on a Mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install jq | |
brew install wget | |
cd ~ | |
version=$(curl https://api.github.com/repos/hashicorp/terraform/releases/latest --silent | jq ".tag_name" -r) | |
version=$(echo $version | sed 's/v//g') # get rid of 'v' from version number | |
echo "Installing Terraform $version." | |
url="https://releases.hashicorp.com/terraform/$version/terraform_$(echo $version)_darwin_amd64.zip" | |
wget $url | |
unzip "terraform_$(echo $version)_darwin_amd64.zip" | |
chmod +x terraform | |
sudo mv terraform /usr/local/bin/ | |
echo "Terraform $version installed." | |
rm "terraform_$(echo $version)_darwin_amd64.zip" | |
echo "Install files cleaned up." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment