Terraform Cheat Sheet

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production; see the section bibliography for the reference material consulted while preparing these pages.

A single-page, colour-coded summary of the Terraform essentials — the write, plan and apply workflow and the everyday CLI commands and environment variables, the HCL skeleton, types, expressions and the most useful functions, meta-arguments, variable precedence and validation, state and backends, modules, import and refactoring blocks, sensitive, ephemeral and write-only values, testing, quality scanning and policy, CI with OIDC, HCP Terraform and Stacks, a Terraform versus OpenTofu comparison, a troubleshooting table and a strip of what changed since older tutorials — handy for quick memorization or as a printable desk reference through the downloadable PDF. It reflects Terraform 1.17, OpenTofu 1.13, the AWS provider 6.x, AzureRM 5.x, the Google provider 8.x and hashicorp/setup-terraform v4. The section home page is Terraform.

For the full explanation, every argument, and additional examples, see the dedicated pages:

OpenTofu — OpenTofu.