Open-Source Wikis

/

Terraform

/

Terraform

hashicorp/terraform

Terraform

Terraform is HashiCorp's tool for building, changing, and versioning infrastructure as code. This repository, hashicorp/terraform, contains Terraform Core: the CLI binary, the configuration language frontend, the resource graph engine, the planning and apply pipeline, and the state management subsystem. Providers are intentionally not in this repo — each provider lives in its own repository and is loaded as a gRPC plugin at runtime.

What this codebase contains

The repository is a single Go module that produces one binary: terraform. From the user's perspective, it is the program that runs commands like terraform init, terraform plan, and terraform apply. From the contributor's perspective, it is:

  • A CLI built on github.com/hashicorp/cli with one subcommand per user-facing operation, dispatched from commands.go in the repo root.
  • A configuration loader that parses HCL into typed Go structures under internal/configs/.
  • A resource graph engine in internal/terraform/ that constructs a directed acyclic graph of "happens-after" relationships, then walks it concurrently to plan or apply changes.
  • A pluggable backend system in internal/backend/ that decides where state lives (local file, S3, GCS, Azure, Kubernetes, HTTP, HCP Terraform, etc.) and, for the local, remote, and cloud backends, where operations execute.
  • A provider installer in internal/getproviders/ that resolves provider requirements, downloads packages from the Terraform Registry or a mirror, and verifies signatures.
  • A gRPC plugin host in internal/plugin/ and internal/plugin6/ that talks to provider binaries via Protocol Buffers.

Who uses it

Every operator running terraform from a workstation, CI runner, or CD platform. Because Terraform is the reference implementation of the language, every provider author reads parts of this codebase to understand how their plugin will be called.

Where to start

  • Architecture — the request flow from main.go to graph walk, with a Mermaid diagram of the major components.
  • Getting started — clone, build, test, run.
  • Glossary — definitions for workspace, backend, plan, graph, vertex, provider, module, stack, and other terms used throughout the codebase.
  • How to contribute — the PR lifecycle, what kinds of changes are accepted, and how to write a changie entry.
  • Systems — deep dives into each major subsystem.
Source /home/ec2-user/repos/hashicorp_terraform (this clone)
Upstream https://github.com/hashicorp/terraform
License Business Source License 1.1
Go version See .go-version
Current version 1.16.0-dev (from version/VERSION)
Default branch main

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Terraform – Terraform wiki | Factory