Skip to content

Symlinks in Terragrunt #1611

@ArturChe

Description

@ArturChe

Hi!

I have found that Terragrunt does not work with symlinks as expected. Or expected but just in a different way from Terraform.
For example, lets assume that we have such folders structure:

/aaa/bbb/ccc/cloudfront/development
/aaa/bbb/ccc/cloudfront/development/stage
/aaa/bbb/ccc/modules/cloudfront
~/cloudfront_development -> /aaa/bbb/ccc/cloudfront/development

Now, when I am trying to run ~/cloudfront_development$ terragrunt run-all plan it fails with an error:

ERRO[0000] Could not find any subfolders with Terragrunt configuration files
ERRO[0000] Unable to determine underlying exit code, so Terragrunt will exit with error code 1

But commands ~/cloudfront_development$ terragrunt plan and ~/cloudfront_development/stage$ terragrunt plan separatelly works fine.

When I have navigated to /aaa/bbb/ccc/cloudfront/development directly and then run $ terragrunt run-all plan then it worked.

Also, I was trying to get rid of Terraform modules declaration and to declare scripts sources in the Terragrunt configuration terraform block:
replace modules.tf

module "stage" {
  source                          = "../../../modules/cloudfront"
}

with terragrunt.hcl

terraform {
  source = "../../..//modules/cloudfront"
}

But ~/cloudfront_development/stage$ terragrunt plan has also exited with error:

ERRO[0004] Hit multiple errors:
stat /home/modules: no such file or directory
ERRO[0004] Unable to determine underlying exit code, so Terragrunt will exit with error code 1

As you can see, the Terraform is recognizing the source path correctly even when running its commands from the symlink location.

So is it an expected behavior with symlinks in Terragrunt?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions