Open-Source Wikis

/

Terraform

/

Systems

hashicorp/terraform

Systems

Terraform Core is organized as a stack of cooperating subsystems. This index gives the one-line elevator pitch for each, in the order you'd encounter them following the path of a terraform plan invocation.

Entry and dispatch

  • CLI dispatchmain.go, commands.go, the cli.CLI runner, the -chdir option, TF_CLI_ARGS handling, autocomplete.
  • Command package — the per-subcommand handlers in internal/command/, the shared command.Meta, flag parsing, and the views that render output.

Configuration and language

  • Configuration loadinginternal/configs/. HCL parsing, schema, modules, providers, test files.
  • Language evaluationinternal/lang/. Expression evaluation, references, the function library, marks (sensitive, ephemeral).
  • Addressesinternal/addrs/. Typed addresses for resources, modules, providers, references.

The graph engine

  • Terraform Core engineinternal/terraform/. terraform.Context, graph builders, transforms, EvalContext, vertex evaluation.
  • DAG primitiveinternal/dag/. The directed-acyclic-graph type and walk algorithm shared by every engine subsystem.

State and plans

  • Stateinternal/states/, statefile, statemgr. The in-memory state, its JSON serialization, and the synchronizer.
  • Plansinternal/plans/, planfile. Proposed and applied changes, the plan file format, deferred actions.

Backends and HCP Terraform

  • Backendsinternal/backend/. State storage, the backend init registry, the local backend that wraps everything else.
  • HCP Terraform / Cloud integrationinternal/cloud/, internal/backend/remote/. The cloud {} block and remote-operations backend.

Provider plumbing

  • Provider installer (getproviders)internal/getproviders/, internal/depsfile/, internal/providercache/. Resolution, download, signature verification, the .terraform.lock.hcl file.
  • Plugin protocolinternal/plugin/, internal/plugin6/, docs/plugin-protocol/. The gRPC handshake, two protocol versions, host-side wrappers.

Higher-level features

  • Stacksinternal/stacks/. The stack-of-components abstraction and its runtime.
  • Native test frameworkinternal/moduletest/, the terraform test command. .tftest.hcl files, mock providers, run lifecycle.
  • RPC APIinternal/rpcapi/. The gRPC surface that lets external tools (HCP Terraform, IDE plugins) drive Terraform Core directly without invoking the CLI.

Cross-cutting

How to read this section

The pages above are written so that you can pick any one and read it in isolation. They link generously to one another and to source code. When the engine or a feature spans multiple subsystems (like ephemeral values, which touch the language, the state, and the plan), follow the cross-links rather than expecting any single page to cover the entire feature.

For the executive summary of how the subsystems fit together, see overview/architecture.

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

Systems – Terraform wiki | Factory