Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 154

Which of the following statements about local modules is incorrect?

    Correct Answer: C

    Local modules are sourced from a directory on disk and are used to organize and reuse Terraform code within a project. However, they do not support versions. This means changes to a local module will affect all resources using that module, as there is no versioning mechanism for local modules within Terraform.

Discussion
rotimislawOption: A

Why not A? Are local modules cached or not?

HizumiOption: C

Answer is C. In particular, modules sourced from local file paths do not support version; since they're loaded from the same source repository, they always share the same version as their caller. Reference: https://www.terraform.io/language/modules/syntax

LemonadeSoftwareOption: C

The correct answer is C. "Local modules support versions" is incorrect. A. This statement is incorrect. Local modules are cached by the terraform init command. When you run terraform init, Terraform downloads and installs the modules specified in the configuration, including local modules, and caches them in the .terraform directory. B. This statement is correct. Local modules are sourced from a directory on disk. You can specify the path to the directory containing your local module in your Terraform configuration. C. This statement is incorrect. Local modules do not support versions in the same way remote modules hosted on version control systems (e.g., Git) do. Local modules are typically referenced by a relative or absolute path, and there is no versioning mechanism built into Terraform for local modules. D. This cannot be the correct answer because Statement B is correct. E. This cannot be the correct answer because Statement C is incorrect. So, the correct answer is C.

dinesh198728Option: C

Version constraints are supported only for modules installed from a module registry, such as the public Terraform Registry or Terraform Cloud's private module registry. Other module sources can provide their own versioning mechanisms within the source string itself, or might not support versions at all. In particular, modules sourced from local file paths do not support version; since they're loaded from the same source repository, they always share the same version as their caller.

depal_dhirOption: C

https://www.terraform.io/language/modules/syntax

campsOption: C

C. Local modules support versions. Local modules are sourced from a directory on disk and are typically used to organize and reuse Terraform code within a project. However, local modules do not support versions. This means that if you make changes to a local module, those changes will be reflected in all resources that use that module, regardless of when those resources were created.