云网牛站
所在位置:首页 > Linux教程 > 在Ubuntu 18.04/CentOS 7中安装Terraform 0.11.11的方法

在Ubuntu 18.04/CentOS 7中安装Terraform 0.11.11的方法

2019-02-18 15:54:16作者:曾中位稿源:云网牛站

本文介绍在Ubuntu 18.04/CentOS 7操作系统中安装Terraform 0.11.11的方法,采用本方法也可以安装任何的Terraform版本,比如terraform_0.10.0版本等。

 

在Ubuntu 18.04 LTS/CentOS 7中安装Terraform

当前最新版本是Terraform 0.11.11,Terraform下载地址:

在Ubuntu 18.04/CentOS 7中安装Terraform 0.11.11的方法

1、现在需要确保系统中已安装wget:

sudo apt-get install wget #对于Ubuntu系统

sudo yum install wget #对于CentOS系统

2、然后下载terraform:

wget https://releases.hashicorp.com/terraform/0.11.11/terraform_0.11.11_linux_amd64.zip

若要安装其它的Terraform版本,请自行更改下载链接。

3、下载后,提取zip文件:

$ sudo apt-get install unzip #对于Ubuntu

$ sudo yum install unzip     #对于CentOS 7

$ unzip terraform_0.11.11_linux_amd64.zip

Archive:  terraform_0.11.11_linux_amd64.zip

inflating: terraform

4、这将在你的工作目录上创建一个terraform二进制文件,将此文件移动到目录/usr/local/bin:

sudo mv terraform /usr/local/bin/

5、这将使所有用户帐户都可以访问terraform:

$ which terraform

/usr/local/bin/terraform

6、确认已安装的版本,运行以下命令:

$ terraform -v

Terraform v0.11.11

7、验证:

# terraform

Usage: terraform [-version] [-help] <command> [args]

下面列出了可用的执行命令:

Common commands:

apply:Builds or changes infrastructure

console:Interactive console for Terraform interpolations

destroy:Destroy Terraform-managed infrastructure

env:Workspace management

fmt:Rewrites config files to canonical format

get:Download and install modules for the configuration

graph:Create a visual graph of Terraform resources

import:Import existing infrastructure into Terraform

init:Initialize a Terraform working directory

output:Read an output from a state file

plan:Generate and show an execution plan

providers:Prints a tree of the providers used in the configuration

push:Upload this Terraform module to Atlas to run

refresh:Update local state file against real resources

show:Inspect Terraform state or plan

taint:Manually mark a resource for recreation

untaint:Manually unmark a resource as tainted

validate:Validates the Terraform files

version:Prints the Terraform version

workspace:Workspace management

All other commands:

debug:Debug output management (experimental)

force-unlock:Manually unlock the terraform state

state:Advanced state management

 

相关主题

在Fedora 29系统中下载及安装Terraform的方法

精选文章
热门文章