Skip to main content
As you design your infrastructure with Terragrunt, leveraging its built-in functions can greatly enhance modularity, maintainability, and dynamic configuration. Below, we present a concise overview of core Terragrunt functions, along with practical examples and links to further resources.

Core Terragrunt Functions

Use run_cmd with caution. Executing shell commands can expose sensitive information or introduce security risks. Always validate inputs and avoid hardcoding credentials.
The image lists Terragrunt functions in a vertical flowchart format, including functions like read_terragrunt_config and run_cmd.

Combining Terragrunt with Terraform Functions

Terragrunt functions become even more powerful when combined with Terraform’s native functions. For example, to extract just the directory name of your current Terragrunt configuration, you can use Terraform’s basename together with get_terragrunt_dir:
This pattern helps you dynamically name resources or output modules based on directory structure—ideal for large, multi-environment projects.

Watch Video