What does `terraform init` do for modules and when must you re-run it?
AdvancedConceptModules
Answer
It downloads remote modules into .terraform/modules and records them in modules.json. Re-run init after adding a module, changing source or version, or editing local module paths in a way that changes the module tree. Local path modules are referenced in place rather than copied, so edits to them apply immediately.
More on Modules
What is a Terraform module and why use one?BeginnerHow do you call a module?BeginnerHow do inputs and outputs work with modules?BeginnerWhich module source types exist and where does `version` apply?IntermediateHow should you version and pin modules?IntermediateCan you use `count` and `for_each` on modules?Intermediate