linuxlab.io
Tutorials▾
  • Linux & networking
    File system, processes, TCP/IP, BGP and OSPF
    →
  • Terraform & IaC
    HCL, state, plan/apply on a LocalStack sandbox
    →
  • Git & GitHub
    Object model, plumbing, branching, GitHub Actions
    →
All tutorials →
PricingAboutSign inCreate account
/
Intro
Lessons
Footer
linuxlab-TutorialsPricingAboutPrivacy & cookies
Copyright © 2026 LinuxLab. All rights reserved.
linuxlab.io
Tutorials▾
  • Linux & networking
    File system, processes, TCP/IP, BGP and OSPF
    →
  • Terraform & IaC
    HCL, state, plan/apply on a LocalStack sandbox
    →
  • Git & GitHub
    Object model, plumbing, branching, GitHub Actions
    →
All tutorials →
PricingAboutSign inCreate account
/
  • Introduction
  • Lessons
  • How it works
  • Knowledge base
  • Cheat sheet
  • Capstone
  • Interview prep
home/terraform/kb/Debugging

kb/debugging

Terraform debugging: TF_LOG, console, validate

Terraform debugging tools for when `apply` fails or `plan` shows something strange: TF_LOG=DEBUG for a verbose log, `terraform console` to check expressions interactively, `terraform validate` to check syntax without a cloud. Without them, debugging is guesswork.

  • tf-common-errorsCommon Terraform Errors and How to Fix Them

    A catalog of the Terraform errors you will hit again and again: cycle dependencies, "value depends on resource attributes that cannot be determined until apply", state lock, inconsistent plan, "for_each argument cannot include keys derived from resource attributes". For each one, the cause and the fix.

  • tf-plan-diffHow to read a terraform plan: symbols, formatting, traps

    A plan shows a diff: `+` create, `~` update in place, `-/+` replace, `-` destroy, `<=` data read. The summary line at the bottom reads `Plan: X to add, Y to change, Z to destroy`. The rule that matters: a second plan after apply should be clean ("No changes").

  • tf-log-debugTF_LOG: Terraform diagnostic logs

    `TF_LOG` is an environment variable. It turns on Terraform's diagnostic logs: internal steps, HTTP requests to the cloud, dependency resolution. The levels are TRACE, DEBUG, INFO, WARN, ERROR. For everyday work DEBUG is enough. TF_LOG_PATH writes the output to a file.

Footer
linuxlab-
Copyright © 2026 LinuxLab. All rights reserved.
Tutorials
Pricing
About
Privacy & cookies