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/cliwith one subcommand per user-facing operation, dispatched fromcommands.goin 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 thelocal,remote, andcloudbackends, 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/andinternal/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.goto 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
changieentry. - Systems — deep dives into each major subsystem.
Repository quick links
| 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.