liveBook · Manning

Reconciliation

As explained in Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu

Reconciliation is the repeated process of comparing actual system state with desired state and applying changes to reduce their difference.

Reconciliation repeatedly compares a system’s actual state with its declarative desired state, then applies changes that reduce the difference. In infrastructure management, Terraform detects differences through a new plan and can correct them by applying that plan. section 8.3 section 8.6.4

A reconciliation system typically:

  • Stores the desired configuration in a versioned, immutable source of truth such as a shared Git repository. section 8.3
  • Pulls that configuration automatically and compares it with the running infrastructure. section 8.3
  • Detects drift and applies the resulting plan when correction is authorized. section 8.3.2 section 8.6.4

Scheduled drift correction

Suppose running infrastructure no longer matches the configuration stored in Git. A delivery system periodically pulls the repository, runs Terraform to create a new plan, and applies that plan to restore the declared state. Running this only for pull requests or merges can miss later drift; scheduled reconciliation continues to check the system. Teams may detect drift without automatically correcting it, instead sending notifications such as Slack alerts for human review. section 8.3.2 section 8.6.4

“Continuously” means that reconciliation keeps occurring, not that it must happen instantaneously. Terraform provides detection and correction capabilities, while a larger delivery system supplies the repeated execution needed for continuous reconciliation. section 8.3 section 8.3.2

How Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu covers it

How deep it goes
Explains desired state, drift, planning, correction, scheduling, and human-review tradeoffs, but not reconciliation internals.
Examples
Uses Terraform plans, Git repositories, scheduled runs, pull requests, merges, and Slack drift notifications.
What it assumes
Assumes declarative configuration, Terraform, Git repositories, infrastructure state, and drift as working concepts.
What you can do after
Diagnose drift with Terraform plans and apply or review corrections through an automated delivery system.
How it connects
Connects declarative configuration, Terraform, GitOps, infrastructure as code, drift detection, continuous delivery, and continuous deployment.

Also explained in

Compare how 7 books explain reconciliation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu. The section links point to the parts of the book it draws on.