Terragrunt’s built-in functionDocumentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
find_in_parent_folders enables recursive searches up your directory tree to locate a specific file or folder. This approach is invaluable when you need to reference shared configurations or modules in a multi-layered project, removing the brittleness of hardcoded relative paths.

Why Use find_in_parent_folders?
By leveraging this function, you can:
- Dynamically adapt configuration based on files located higher in the hierarchy
- Inherit and override settings across environments without manual path tweaks
- Maintain cleaner, DRY (Don’t Repeat Yourself) configurations

Best Practices
- Organize projects into clear, modular, hierarchical folders
- Use
find_in_parent_foldersinsideincludeblocks to locate root-levelterragrunt.hcl - Avoid embedding static paths; let Terragrunt resolve them dynamically

find_in_parent_folders stops when it hits the filesystem root or finds the target file. If the file isn’t present, Terragrunt throws an error.Real-World Example
Imagine a VPC module that relies on common variables fromcommon.hcl.
Before (hardcoded path):
vpc/ folder is nested, Terragrunt will climb up until it finds common.hcl.
Verify with Terragrunt
Run:common.hcl, for example: