A practitioner adds a module block that points at a subdirectory of the current project, then runs 'terraform init'. What does Terraform do to retrieve this module?
module "network" {
source = "./modules/network"
}- AIt queries the public Terraform Registry for a module named 'network' and downloads the newest matching version into the cache.
- BIt reads the module directly from the given relative path on disk without downloading anything, because a source beginning with './' is a local path. Correct
- CIt clones the path as a Git repository into the '.terraform/modules' directory before the configuration can be used.
- DIt copies the subdirectory into '.terraform/modules' and thereafter ignores later edits to the original files.
Why A is wrong: Registry retrieval is tempting because init does fetch registry modules, but a registry source must be a namespaced address such as 'namespace/name/provider', not a relative path.
Why B is correct: A source starting with './' or '../' is a local path, so Terraform reads the files in place during init and performs no download.
Why C is wrong: Git cloning happens only for a Git source address, and a leading './' is never interpreted as a Git URL, so no clone occurs for a local path.
Why D is wrong: This sounds plausible because remote modules are cached under '.terraform/modules', but local modules are referenced in place and edits are picked up on the next run.