OpenTofu: Open Source Infrastructure as Code

Shriira Press

Preface

Infrastructure as code that stays open — declare your cloud in HCL, plan it, apply it, and own the tool itself, with OpenTofu.

Welcome to OpenTofu: Open Source Infrastructure as Code.

OpenTofu is an open-source infrastructure-as-code tool, governed under the Linux Foundation, that lets you declare cloud and platform resources in configuration files and bring them into being with a single workflow. Born as a community fork of Terraform after its license changed, OpenTofu stays a drop-in, permanently open tool while pushing its own features forward. This book takes you from the problem of managing infrastructure by hand to a working command of the whole system: the HCL configuration language, the provider plugin model that talks to thousands of APIs, the state file that remembers your infrastructure, the plan-and-apply workflow built on a dependency graph, modules for reuse, and OpenTofu's own additions — client-side state encryption, early evaluation of variables in backends and providers, and dynamic provider expansion with for_each. It closes with testing, collaboration, and the practices that keep real infrastructure healthy.

This title is part of the ShriIra library and is free to read in full, right here — our small contribution to making world-class knowledge easy to reach.

A note on reading it: open the Contents menu at the top of the reader to jump between chapters, use the Aa menu to set a comfortable text size, theme (light, sepia, or night), and single- or two-page layout. Your place is saved automatically, so you can always pick up where you left off.

We hope it serves you well.

— Shriira Press

Contents

  1. Chapter 1 — What OpenTofu Is
  2. Chapter 2 — The Infrastructure-as-Code Problem
  3. Chapter 3 — The HCL Configuration Language
  4. Chapter 4 — Providers and the Plugin Model
  5. Chapter 5 — State
  6. Chapter 6 — Plan and Apply
  7. Chapter 7 — Modules
  8. Chapter 8 — State Encryption
  9. Chapter 9 — Early Evaluation and Dynamic Providers
  10. Chapter 10 — OpenTofu in Practice
0%
1/1