Terraform is a program used to build infrastructure automatically—without having to access a cloud provider's console. Terraform files are an example of infrastructure as code (IaC). They are easily read—and written.
Terraform can automatically build, update, and destroy infrastructure. It can create all kinds of resources: virtual machines, users, network devices, and security components. It enables a person to work with multiple cloud providers (AWS, Azure, Google, etc...) and on-premises systems (VMware, KVM, Proxmox) and much more.
The Terraform program is developed by the company HashiCorp. It is freely downloadable.
Watch the following video to see how to install Terraform on Debian Linux. Read on for more information.
Video
Want to install Terraform yourself? See this link. There you will find source downloads and all of the package manager code snippets you need to install Terraform to Linux, macOS, and Windows.
The code snippets can change over time, but here is an example for Debian Linux:
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg \
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list \
sudo apt update && sudo apt install terraform
The commands above setup the GPG keyring, install the HashiCorp repository, and install Terraform. Subsequent HashiCorp programs can simply be installed with the package manager. For example, if you wanted to install HashiCorp Vault:
sudo apt install vault
Go here for an article/video on installing from binary.
Download the latest source code for Terraform from: https://github.com/hashicorp/terraform
When your installation is finished, check it with this command:
terraform version
That should display results similar to the following:
╰─>$ terraform version
Terraform v1.3.7
on linux_amd64
If you are using a Bash terminal, consider installing Terraform autocomplete:
terraform -install-autocomplete
Then restart your terminal so that subcommands can be completed with the tab key.
To learn more about Terraform, use the terraform -help
command or see their documentation, or both!
🌎 Terraform Video Course
It's finally published! The HashiCorp Certified Terraform Associate (003) video course is ready for viewing on InformIT & O'Reilly*. Check it out at the links below.
InformIT
O'Reilly*