Step-by-step tutorial of how to download and install Terraform on Windows, Linux and Mac OS.

Terraform is distributed as a binary package for all supported platforms and architectures and must first be installed on your machine.

Check out the releases CHANGELOG for more information on the latest release and choose the version that is required for your Operating System and your project. If you just getting started with Terraform , I suggest you to get the latest release.

Download Terraform

You can  download a version of Terraform from the releases service.

Install Terraform – Windows

  1. Download terraform for windows

    • Note: Terraform is packaged as a zip archive, so after downloading Terraform, unzip the package. Terraform runs as a single binary named terraform. Any other files in the package can be safely removed and Terraform will still function
  2. Copy files from the zip to “c:\terraform” for example. That’s our terraform PATH.
  3. The final step is to make sure that the terraform binary is available on the PATH.

General Information

  • The PATH is the system variable that your operating system uses to locate needed executables from the command line or Terminal window.
  • The PATH system variable can be set using System Utility in control panel on Windows, or in your shell’s startup file on Linux.

Windows 10 and Windows 8

  1. In Search, search for and then select: System (Control Panel)
  2. Click the System and Security link.
  3. Click the System link.
  4. Click the Advanced system settings link.
  5. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  6. In the Edit System Variable (or New System Variable) window, append at the end of the PATH environment variable the value of terraform path ex.”c:\terraform;” . Click OK. Close all remaining windows by clicking OK.
  7. Reopen Command prompt window, and run terraform.

Windows 7

  1. From the desktop, right click the Computer icon.
  2. Choose Properties from the context menu.
  3. Click the Advanced system settings link.
  4. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  5. In the Edit System Variable (or New System Variable) window, append at the end of the PATH environment variable the value of terraform path ex.”c:\terraform;” . Click OK. Close all remaining windows by clicking OK.
  6. Reopen Command prompt window, and run terraform.

Windows XP

  1. Select Start, select Control Panel. double click System, and select the Advanced tab.
  2. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  3. In the Edit System Variable (or New System Variable) window, append at the end of the PATH environment variable the value of terraform path ex.”c:\terraform;” . Click OK. Close all remaining windows by clicking OK.
  4. Reopen Command prompt window, and run terraform.

Install Terraform – Linux

  1. Download terraform for linux

     
    1
    $ wget https://releases.hashicorp.com/terraform/0.xx.x/terraform_0.xx.x_linux_amd64.zip
    • Note: Terraform is packaged as a zip archive, so after downloading Terraform, unzip the package. Terraform runs as a single binary named terraform. Any other files in the package can be safely removed and Terraform will still function
  2. Install unzip
     
    1
    $ sudo apt-get install unzip
  3. Unzip and set path.
     
    1
    2
    $ unzip terraform_0.11.1_linux_amd64.zip
    $ sudo mv terraform /usr/local/bin/

Install Terraform – Mac OS

The easiest and quickest way to install Terraform is using Homebrew.

 
1
$ brew install terraform

Or Manually if the latest version is not ideal for your needs.

  1. Download terraform for macos

    • Note: Terraform is packaged as a zip archive, so after downloading Terraform, unzip the package. Terraform runs as a single binary named terraform. Any other files in the package can be safely removed and Terraform will still function
  2. Extract files from the zip to “$HOME/Downloads/terraform” for example.
  3. The final step is to make sure that the terraform binary is available on the PATH.
  4. Copy binary to a place in the path such as /usr/local/bin/terraform
 
1
$ cp $HOME/Downloads/terraform /usr/local/bin/

Verify Install

When you’re done, you should be able to run the terraform command and get the usage information:

 
 
 
 
 

Arduino

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$ terraform
Usage: terraform [--version] [--help] <command> [args]
 
The available commands for execution are listed below.
The most common, useful commands are shown first, followed by
less common or more advanced commands. If you're just getting
started with Terraform, stick with the common commands. For the
other commands, please read the help and docs before usage.
 
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

Link: https://www.vasos-koupparis.com/terraform-getting-started-install/

最新文章

  1. 集中式vs分布式区别
  2. 浏览器中的Javascript的简单对话框
  3. While循环
  4. 安装运行mariadb时错误:gtid_slave_pos
  5. 动态链接库(DLL)总结
  6. Qrels supervision information以及document collection,如何划分为train、test,保证test中doc对于train来说是new document
  7. 菜鸟-手把手教你把Acegi应用到实际项目中(4)
  8. 03-position和anchorPoint
  9. 【集训笔记】博弈论相关知识【HDOJ 1850【HDOJ2147
  10. C# WinForm多线程(二)ThreadPool 与 Timer
  11. 面试题-Java基础-垃圾回收
  12. 分布式服务dubbo使用
  13. Pandoc将markdown转换为word
  14. java多线程的(一)-之java线程的使用
  15. 【查漏补缺】File的path、absolutePath和canonicalPath的区别
  16. JavaScript初学者必看“this”
  17. 亲测:LNMP环境下,解决项目缓冲慢、502以及配置https的问题
  18. C++中vector使用详细说明 (转)
  19. 专业语音芯片MT8516 华为AM08蓝牙音箱
  20. 【leetcode 简单】 第一百零九题 最小移动次数使数组元素相等

热门文章

  1. 20162328蔡文琛 week06
  2. 关于cnblog.com的用户体验
  3. UVA 10328 - Coin Toss dp+大数
  4. 前端系列之HTML基础知识概述
  5. Mac10.11.2 Apache 服务配置
  6. erlang init:stop()不起效
  7. js 实现路由功能
  8. 【.Net】C# 将Access中时间段条件查询的数据添加到ListView中
  9. HDU4675_GCD of Sequence
  10. [Code Festival 2017 qual A] B: flip