Terraform 100: Introduction & Install

What is Terraform?

Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.

The key features of Terraform are:

  • Infrastructure as Code
  • Execution Plans
  • Resource Graph
  • Change Automation

tfenv

tfenv: Terraform version manager

tfenv github

  • install tfenv

    Install via Homebrew
    $ brew install tfenv

  • usage
    1
    2
    $ tfenv install 0.7.0
    $ tfenv install latest
1
2
3
# use a specific version
$ tfenv use 0.7.0
$ tfenv use latest
1
2
3
#uninstall
$ tfenv uninstall 0.7.0
$ tfenv uninstall latest
.terraform-version

If you put .terraform-version file on your project root, or in your home directory, tfenv detects it and use the version written in it.

I have installed two different version on my mac.

Ihen I set version to v0.12.4 in .terraform-version file

1
2
3
4
5
➜   terraform --version
Terraform v0.12.4
+ provider.aws v2.25.0
+ provider.random v2.2.0
+ provider.template v2.1.2

Then I change the verson to v0.12.5 in .terraform-version file

1
2
3
4
5
6
7
8
➜   terraform --version
Terraform v0.12.5
+ provider.aws v2.25.0
+ provider.random v2.2.0
+ provider.template v2.1.2

Your version of Terraform is out of date! The latest version
is 0.12.7. You can update by downloading from www.terraform.io/downloads.html

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2019-2024 John Doe
  • Visitors: | Views:

请我喝杯咖啡吧~