Skip to main content
Knowledge Base

Passing local values to read_terragrunt_config?

Answer

Wondering if it's possible to do `values = read_terragrunt_config(templatefile("impl.hcl.tftpl", {k = "value"})` or something similar, what I'm trying to achieve is separating the cloud implementation from the root terragrunt.hcl file but the impl.hcl.tftpl needs the `path_relative_to_include()` (hence the templatefile()). --- <ins datetime="2022-07-20T01:19:30Z"> <p><a href="https://support.gruntwork.io/hc/requests/109020">Tracked in ticket #109020</a></p> </ins>

This is not possible, although we are open to a PR that implements something like this (which would probably be another function `read_terragrunt_config_string`). As a workaround, you can use YAML or JSON, and use `jsondecode` or `yamldecode`, assuming all you need is to extract some template processed data.