Question 370
A module is stored in a subdirectory of a monorepo, and Terraform should load only the chosen module directory. Which Terraform concept most directly explains the appropriate approach?
Explanation
Correct Answer
Use the supported source address syntax with the module subdirectory after a double slash. The initialized module code comes from the intended nested directory.
Incorrect Answers
Pass the root variable explicitly as an argument in the child module block. Use the supported source address syntax with the module subdirectory after a double slash.
Call the module from each root configuration with stack-specific inputs. The initialized module code comes from the intended nested directory.
Pin the Git module using the supported source ref query instead of a registry version argument. Use the supported source address syntax with the module subdirectory after a double slash.