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

2 篇文章 0 订阅
1 篇文章 0 订阅

本文介绍在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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值