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.
More on IaC and Terraform Fundamentals
What is Infrastructure as Code and why do teams use it?BeginnerWhat is the difference between declarative and imperative infrastructure tools?BeginnerWhat is Terraform and what problem does it solve?BeginnerWhat is HCL and can Terraform use anything else?BeginnerWhich files make up a typical Terraform root module?BeginnerHow does Terraform work internally?Advanced