# Terragrunt

[Terragrunt](https://terragrunt.gruntwork.io/) is a lightweight wrapper for [Terraform](terraform.html) and [OpenTofu](opentofu.html) that helps you manage complex infrastructure setups by improving their structure and reducing code duplication.

IntelliJ IDEA recognizes Terragrunt and Terragrunt Stack files and provides coding assistance for them, including code completion for root blocks, properties, functions, and attributes, as well as templates for creating new Terragrunt and Terragrunt Stack files.

Procedure: Specify the Terragrunt executable path

To run Terragrunt commands from the IDE using run configurations, you need to have Terragrunt installed on your machine.

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Tools | Terraform Tools`.

2. In most cases, IntelliJ IDEA detects the path to the Terragrunt executable automatically. If the IDE does not detect the version and path to the executable, click Detect and Test.

If Terragrunt is not installed on your machine, click Install.

![Terraform Tools settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/terraform_tools_settings.png)

3. If necessary, you can specify the path to Terragrunt manually in the Terragrunt executable path field.

