mcpField
T
Terraform CLI

Terraform CLI

Official
developer.hashicorp.comCloud & DevOps50.1kterraformUpdated today
RepositoryVisit website

About Terraform CLI

Terraform CLI is HashiCorp's infrastructure-as-code tool for defining and deploying cloud resources through declarative configurations. It supports multiple cloud providers, plan-apply workflows, and remote state management for team collaboration.

Key features

  1. 01Declare infrastructure resources in .tf files using a declarative syntax
  2. 02Preview infrastructure changes with terraform plan before applying them
  3. 03Store and manage infrastructure state remotely for team collaboration and version control

Use cases

  1. 01Track infrastructure changes in version control and review resource deployments
  2. 02Deploy resources consistently across multiple cloud platforms like AWS, Azure, and GCP
  3. 03Reuse and share infrastructure modules and best practices across teams

Install

Pick your OS or package manager and run the command in a terminal.

$
brew tap hashicorp/tap && brew install hashicorp/tap/terraform

Once installed, runterraform --versionto confirm it works.

Example commands

Common commands in the order you’d use them.

01
terraform init
02
terraform plan
03
terraform apply

Details

From the project README

Terraform

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: Infrastructure is described using a high-level configuration syntax. This allows a blueprint of your datacenter to be versioned and treated as you would any other code. Additionally, infrastructure can be shared and re-used.

  • Execution Plans: Terraform has a "planning" step where it generates an execution plan. The execution plan shows what Terraform will do when you call apply. This lets you avoid any surprises when Terraform manipulates infrastructure.

  • Resource Graph: Terraform builds a graph of all your resources, and parallelizes the creation and modification of any non-dependent resources. Because of this, Terraform builds infrastructure as efficiently as possible, and operators get insight into dependencies in their infrastructure.

  • Change Automation: Complex changesets can be applied to your infrastructure with minimal human interaction. With the previously mentioned execution plan and resource graph, you know exactly what Terraform will change and in what order, avoiding many possible human errors.

For more information, refer to the What is Terraform? page on the Terraform website.

Getting Started & Documentation

Documentation is available on the Terraform website:

If you're new to Terraform and want to get started creating infrastructure, please check out our Getting Started guides on HashiCorp's learning platform. There are also additional guides to continue your learning.

Show off your Terraform knowledge by passing a certification exam. Visit the certification page for information about exams and find study materials on HashiCorp's learning platform.

Developing Terraform

This repository contains only Terraform core, which includes the command line interface and the main graph engine. Providers are implemented as plugins, and Terraform can automatically download providers that are published on the Terraform Registry. HashiCorp develops some providers, and others are developed by other organizations. For more information, refer to Plugin development.

License

Business Source License 1.1

Comments

Markdown supported