Home / Companies / Spacelift / Blog / Post Details
Content Deep Dive

Terraform File Paths – Path Module, Root and CWD

Blog post from Spacelift

Post Details
Company
Date Published
Author
Jack Roper
Word Count
1,013
Language
English
Hacker News Points
-
Summary

In this article, we discuss the different types of file paths in Terraform: root module path (path.root()), current working directory (path.cwd()), and module path (path.module()). The root module path refers to the main directory where your Terraform configuration files are located, while the current working directory is the directory from which the Terraform command is executed. Module paths specify the directory where a module's Terraform files are located. We also explain how to use these functions in your code and provide examples of their usage. Additionally, we mention Spacelift as a tool that can help manage Terraform infrastructure more effectively.