Terraform is a cloud-agnostic Infrastructure automation tool created by the awesome HashiCorp Engineers to help you with the infrastructure resource management using code. Terraform allows you build, change, and version infrastructure deployed on popular cloud environments and on premise . This short article will show you how to install terraform on CentOS 8 Linux system.
Before you get started ensure you have a sudo user that will be used to install Terraform on CentOS 8 Linux machine. Below few steps should work fine for you.
Step 1: Install wget
We’ll use wget command to download the latest binary archive of Terraform.
sudo dnf -y install terraform
Step 2: Install Terraform on CentOS 8
The next step is to install Terraform on a CentOS 8 Linux. But first download binary archive file.
TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d ",v | awk '{$1=$1};1'`
wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip
Extract the downloaded archive
$ unzip terraform_${TER_VER}_linux_amd64.zip
Archive: terraform_xxx_linux_amd64.zip
inflating: terraform
Then move the binary file to directory in your PATH.
sudo mv terraform /usr/local/bin/
Step 3: Confirm Terraform Installation on CentOS 8
Check the version of Terraform to validate our installation:
$ terraform version
Terraform v0.12.26
provider.hcloud v1.16.0
You can then refer to some of the guides we have on using Terraform.
How to Provision VMs on KVM with Terraform
How To Provision VMs on oVirt / RHEV with Terraform
Deploy VM Instances on Hetzner Cloud with Terraform
Build AWS EC2 Machine Images (AMI) With Packer and Ansible
Other Learning materials include:
<img data-ezsrc="https://kirelos.com/wp-content/uploads/2020/06/echo/icon_udemy-com.png5ee760bfc32bc.jpg" ezimgfmt="rs rscb8 src ng ngcb8" src="data:image/svg xml,”>Udemy.com