Quickstart
Get started with Terraform in minutes with a simple example
Installation
Install Terraform on your system and verify the installation
Core Concepts
Understand Terraform’s key concepts and workflow
CLI Reference
Explore all available Terraform commands and options
What is Terraform?
Terraform codifies cloud APIs into declarative configuration files, allowing you to define infrastructure using a high-level configuration syntax. This enables you to version, reuse, and share infrastructure configurations just like application code. With Terraform, you write configuration files that describe the components needed to run your applications or services. Terraform then generates an execution plan describing what it will do to reach the desired state, and executes that plan to build the infrastructure.Key Features
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.The
terraform plan command shows you exactly what changes will be made before you apply them, helping you catch mistakes before they affect your 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.How Terraform Works
Write Configuration
Define your infrastructure in
.tf files using HashiCorp Configuration Language (HCL)Apply Changes
Run
terraform apply to create, update, or delete infrastructure to match your configurationPrimary Commands
Terraform’s workflow revolves around five primary commands:init: Initialize a Terraform working directoryvalidate: Validate the Terraform configuration filesplan: Generate and show an execution planapply: Build or change infrastructuredestroy: Destroy previously-created infrastructure
Getting Started
Ready to try Terraform? Head over to our Quickstart guide to create your first infrastructure with Terraform in just a few minutes.Terraform is licensed under the Business Source License 1.1. Check the license terms for your use case.
Additional Resources
Terraform Website
Official Terraform documentation and resources
HashiCorp Learn
Interactive tutorials and learning paths
Community Forums
Get help and discuss with the Terraform community
Terraform Registry
Browse providers and modules from the community