Interview Prep/Terraform/Loops, Conditionals, Dynamic Blocks and Functions

What are `path.module`, `path.root` and `path.cwd`?

BeginnerConceptLoops, Conditionals, Dynamic Blocks and Functions
Answer

path.module is the directory of the module containing the expression, path.root is the root module's directory, path.cwd is where Terraform was launched. Use path.module when loading files that live next to a module so it works when called from anywhere.

All Terraform questions Roadmap: Terraform

More on Loops, Conditionals, Dynamic Blocks and Functions