HashiCorp has recently announced in this blog post the possibility to download their tools (Terraform, Packer, Consul, …) via a classical and official Linux packages manager.
In this blog post, I expose how to use this repository for download the Terraform binary on Linux operating system.
For this performing following steps:
-
Register the Terraform repository
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
-
Update list of packages
sudo apt-get update
-
Optionally, we can check the list of Terraform versions packages available, by running this command:
apt search terraform
-
Then, download the Terraform binary:
sudo apt-get install terraform
-
Finally, check the installed version of Terraform
terraform version
We can now use this script inside automation Terraform installation.
If you are on MacOs you can read this new blog post annoucing the use of Homebrew Tap for download and run HashiCorp tools.
To learn more about the different ways to install Terraform, you can read my new book on Terraform called Terraform Cookbook available on Amazon.
Comments