- Learning DevOps
- Mikael Krief
- 203字
- 2021-06-24 12:32:04
Installing Terraform by script on Linux
The Linux Terraform installation script is as follows:
TERRAFORM_VERSION="0.12.8" #Update with your desired version
curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip \
&& curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS \
&& curl https://keybase.io/hashicorp/pgp_keys.asc | gpg --import \
&& curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig \
&& gpg --verify terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig terraform_${TERRAFORM_VERSION}_SHA256SUMS \
&& shasum -a 256 -c terraform_${TERRAFORM_VERSION}_SHA256SUMS 2>&1 | grep "${TERRAFORM_VERSION}_linux_amd64.zip:\sOK" \
&& unzip -o terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/bin
This script does the following:
- Set the TERRAFORM_VERSION parameter with the version to download.
- Download the Terraform package by checking the checksum.
- Unzip the package in the user local directory.
This script is also available in the GitHub source of this book: https://github.com/PacktPublishing/Learning_DevOps/blob/master/CHAP02/Terraform_install_Linux.sh.
For executing this script, follow these steps:
- Open a command-line Terminal.
- Copy and paste the preceding script.
- Execute it by hitting Enter in the command-line Terminal.
The following screenshot displays an execution of the script for installing Terraform on Linux:

In the execution of the preceding script, we can see the download of the Terraform ZIP package (with the curl tool) and the unzip operation of this package inside the /usr/local/bin folder.
We have just seen the installation of Terraform on Linux; now, let's look at its installation on Windows.
推薦閱讀
- 兒童心理障礙診療學(xué)
- 床旁超聲監(jiān)測(cè)
- 腎病綜合征
- 心理腫瘤學(xué):為癌癥患者及其家庭提供心理學(xué)支持
- Qt5 C++ GUI Programming Cookbook
- 眼科標(biāo)準(zhǔn)數(shù)據(jù)集(2019版)
- 腫瘤防治科普叢書:腦部腫瘤
- 常見(jiàn)惡性腫瘤治療原則與實(shí)施方案
- 腎移植
- 身體關(guān)節(jié)功能篩查及糾正
- 癌癥療愈錄:腫瘤門診敘事紀(jì)實(shí)二
- Hands-On Reactive Programming with Clojure
- 晶狀體病影像學(xué)檢查及診斷
- 頭頸部腫瘤放射治療危及器官勾畫精要
- 上海中山感染探案 疑難病例臨床思維