Open JeanFred opened 1 month ago
I guess I will try using some combination of path_relative_to_include, path_relative_from_include, get_terragrunt_dir and friends until it works :)
Ha! It was easier than I thought. This does the trick:
dependency "a" {
config_path = "${get_terragrunt_dir()}/../a/"
}
Hi,
I think can be also used path_relative_to_include
or get_repo_root
(to pass path relative from repo root):
config_path = "${path_relative_to_include()}/../a/"
References:
https://terragrunt.gruntwork.io/docs/reference/built-in-functions/#path_relative_to_include
https://terragrunt.gruntwork.io/docs/reference/built-in-functions/#get_repo_root
Describe the bug
If a
dependency
block with a relative path is present in a file that is included, the path resolution stops working when that file is included withexpose=true
.Steps To Reproduce
I have a repo which follows the _envcommon pattern described in the live-example − here is a reconstructed, minimal reproduction:
b.hcl
qc/eu-west-1/a/terragrunt.hcl
qc/eu-west-1/b/terragrunt.hcl
When
expose=true
is commented out, all is fine − a Terraform plans runs successfully, and the output froma
is passed tob
With
expose=true
, the plan fails with On latest Terragrunt 0.68.1:on Terragrunt 0.60.1
Expected behavior
The dependency keeps working even after using
expose=true
− or it never works! But it behaves consistently.Versions
Additional context
I guess I will try using some combination of
path_relative_to_include
,path_relative_from_include
,get_terragrunt_dir
and friends until it works :)