Install
https://www.terraform.io/downloads.html
# sudo apt install -y jq
URL=$(wget https://checkpoint-api.hashicorp.com/v1/check/terraform -qO- | jq -r '.current_download_url + "/" + .product + "_" + .current_version + "_linux_amd64.zip"')
wget ${URL} -qP /tmp
unzip -d /tmp /tmp/${URL##*/}
mv /tmp/terraform ~/.local/bin/
# or deploy global
# sudo mv /tmp/terraform /usr/local/bin/
terraform version
Debug
https://www.terraform.io/internals/debugging
# enable
export TF_LOG=DEBUG
# disable
export TF_LOG=ERROR
TF_LOG=debug OS_DEBUG=1 terraform applyCLI
# deploy
terraform init
terraform plan
terraform apply -auto-approve
# format the Terraform files
terraform fmt
# list workspaces
terraform workspace list
# destroy
terraform destroy -auto-approve
Install with Ansible
[embed_url: https://raw.githubusercontent.com/panticz/ansible/master/roles/terraform/tasks/main.yml]