Interview Prep/Terraform/IaC and Terraform Fundamentals

What is in the `.terraform` directory and what belongs in `.gitignore`?

BeginnerConceptIaC and Terraform Fundamentals
Answer

It holds downloaded providers, downloaded modules and backend configuration cache. Ignore .terraform/, *.tfstate, *.tfstate.*, crash.log, *.tfplan and any *.tfvars that contain secrets. Commit .terraform.lock.hcl, all .tf files and non-secret tfvars.

All Terraform questions Roadmap: Terraform

More on IaC and Terraform Fundamentals