How I get the directory name up level?
How can I get the name of the directory up the level where my `terragrunt.hcl` is? ## Example - project-name/ - sqs/ - `terragrunt.hcl` In this context bellow I need to get `project-name`, I've tried the followings functions without success: * `${basename(${get_terragrunt_dir()}../)}` * `basename(${get_terragrunt_dir()}../)` * `${basename(get_terragrunt_dir())../}` * `"${run_cmd("ls -l ../../ | grep '^d' | awk -F' ' '{print $11}'')}"` (In this context the problem is about the double quotes 😅) * `dirname("../../")` * `basename("../../")` Maybe using the `relative path + trimprefix`, but I dont know how to combine and use them 😞 . --- <ins datetime="2023-01-02T19:12:11Z"> <p><a href="https://support.gruntwork.io/hc/requests/109756">Tracked in ticket #109756</a></p> </ins>
Try this: ``` locals { parent = "${get_terragrunt_dir()}/../" name = basename(dirname(local.parent)) } input = { name = local.name } ```