From d591bb9812f246207da12567595767755666f1f9 Mon Sep 17 00:00:00 2001 From: pritho <23241510+pritho@users.noreply.github.com> Date: Thu, 18 Apr 2024 10:16:26 +0200 Subject: [PATCH] issues/3066 - add include description --- docs/_docs/02_features/locals.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/_docs/02_features/locals.md b/docs/_docs/02_features/locals.md index abebbae6f..a45301bc8 100644 --- a/docs/_docs/02_features/locals.md +++ b/docs/_docs/02_features/locals.md @@ -42,9 +42,13 @@ locals { Currently you can only reference `locals` defined in the same config file. `terragrunt` does not automatically include `locals` defined in the parent config of an `include` block into the current context. If you wish to reuse variables globally, consider using `yaml` or `json` files that are included and merged using the `terraform` built in functions -available to `terragrunt`. +available to `terragrunt`. Find an example below. -For example, suppose you had the following directory tree: +Another alternative may be using the option `merge_strategy = "deep"` of the [`include` configuration block](https://terragrunt.gruntwork.io/docs/reference/config-blocks-and-attributes/#include). + +**Example for using `yaml` or `json` files:** + +Suppose you had the following directory tree: ``` .