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.

All Terraform questions Roadmap: Terraform

More on Modules