Hi guys, I’m new to terragrunt and I’ve already been able to do some tasks, but I’m having a hard time, when I try to run the command it shows the following error, can someone help me please:
no such file or directory
My structure is in the following diagram:
.
├── README.md
├── aws
│ ├── ecs-cluster-tools
│ │ ├── dev
│ │ │ └── terragrunt.hcl
│ │ └── prd
│ │
│ ├── ecs-service-tools
│ │ ├── dev
│ │ │
│ │ └── prd
│ │
│ └── network
│ ├── dev
│ │
│ └── prd
│
└── terragrunt.hcl
I’m running the following command:
terragrunt run-all plan --terragrunt-source aws/ecs-cluster-tools/dev/
In the root file I only have the blocks (locals, generate provider and remote state).
In the terragrunt.hcl file inside (aws/ecs-cluster-tools/dev/terragrunt.hcl):
include {
path = find_in_parent_folders()
}
terraform {
source = "git::git@<URL_GIT>terraform-ecs-cluster/devops-tools.git//module?ref=1.0.3"
}
It duplicates folders, as below:
Expected
terragunt/aws/ecs-cluster-tools/dev
What he returns
terragunt/aws/ecs-cluster-tools/dev/aws/ecs-cluster-tools/dev
Error:
INFO[0000] Stack at /terragunt:
=> Module /terragunt/aws/ecs-cluster-tools/dev (excluded: false, dependencies: )
ERRO[0001] Module /terragunt/aws/ecs-cluster-tools/dev has finished with an error: 1 error occurred:
* stat /terragunt/aws/ecs-cluster-tools/dev/aws/ecs-cluster-tools/dev: no such file or directory
prefix=[/terragunt/aws/ecs-cluster-tools/dev]
ERRO[0001] 1 error occurred:
* stat /terragunt/aws/ecs-cluster-tools/dev/aws/ecs-cluster-tools/dev: no such file or directory
ERRO[0001] Unable to determine underlying exit code, so Terragrunt will exit with error code 1
But if I run terragrunt with the terraform modules not inside the dev folder the terragrunt can run without problem.
NOTE: If I run without the parameter “–terragrunt-source” the terragrunt passes successfully, but this structure created will be to serve several modules and they will not be created simultaneously, that’s why I point the “–terragrunt-source” together to the command.
Terraform: v1.0.5
Terragrunt: v0.31.0
Thank you