Open jamie3 opened 5 years ago
What does your terragrunt.hcl
look like?
terraform {
source = "${get_terragrunt_dir()}/../../../../../infrastructure//waf"
}
# Include parent settings
include {
path = "${find_in_parent_folders()}"
}
inputs = {
# IP CIDR which the WAF will block
blacklisted_ips = [
"37.9.0.0/20", # 4096 RU Russian Federation
"37.9.16.0/20", # 4096 KZ Kazakhstan
"37.9.32.0/20", # 4096 RU Russian Federation
"37.9.48.0/21", # 2048 RU Russian Federation
"37.9.64.0/18", # 16384 RU Russian Federation
"37.9.128.0/21", # 2048 RU Russian Federation
"37.9.144.0/20", # 4096 RU Russian Federation
"37.9.240.0/21" # 2048 RU Russian Federation
]
}
Doing more investigation is seems this is a terragrunt issue.
infrastructure\waf
live\production-account\production-env\us-west-2\waf
When I run terraform init
in infrastructure\waf
it successfully downloads the module.
When I run terragrunt init
in the live\production-account\production-env\us-west-2\waf
folder I get the following error:
Initializing modules...
Downloading traveloka/waf-owasp-top-10-rules/aws 0.2.0 for owasp_top_10...
Error: Failed to download module
Could not download module "owasp_top_10" (waf.tf:126) source code from
"https://api.github.com/repos/traveloka/terraform-aws-waf-owasp-top-10-rules/tarball/v0.2.0//*?archive=tar.gz":
open
.terraform\modules\owasp_top_10\traveloka-terraform-aws-waf-owasp-top-10-rules-a0fc16d\.github\CODE_OF_CONDUCT.md:
The system cannot find the path specified..
Error: Failed to download module
Could not download module "owasp_top_10" (waf.tf:126) source code from
"https://api.github.com/repos/traveloka/terraform-aws-waf-owasp-top-10-rules/tarball/v0.2.0//*?archive=tar.gz":
open
.terraform\modules\owasp_top_10\traveloka-terraform-aws-waf-owasp-top-10-rules-a0fc16d\.github\CODE_OF_CONDUCT.md:
The system cannot find the path specified..
[terragrunt] 2019/08/14 15:27:08 Hit multiple errors:
exit status 1
If I change my terragrunt download directory to export TERRAGRUNT_DOWNLOAD=/c/.terragrunt-cache
it works.
Using Windows 10, vscode bash shell.
After I change the download directory I get the error from my original post. I found the issue:
My directory structure is as follows:
infrastructure\modules\my-module (locally developed modules go here)
infrastructure\waf
export TERRAGRUNT_DOWNLOAD=/c/.terragrunt-cache
cd live\production-account\production-env\us-west-2\waf
terragrunt init
Initializing modules...
Downloading traveloka/waf-owasp-top-10-rules/aws 0.2.0 for owasp_top_10...
- owasp_top_10 in .terraform\modules\owasp_top_10\traveloka-terraform-aws-waf-owasp-top-10-rules-a0fc16d
# OK GOOD MODULE WAS DOWNLOADED!!
ls -la C:\.terragrunt-cache\x7-oAnEDG1WwfZ5JhOpHjDxn62s\0BJ6pIZapeyXhNBDvO_JhJyFP9A\modules
drwxr-xr-x 1 Jamie 197121 0 Aug 14 15:31 .
drwxr-xr-x 1 Jamie 197121 0 Aug 14 15:31 ..
drwxr-xr-x 1 Jamie 197121 0 Aug 14 15:31 my-module
ls -la C:\.terragrunt-cache\x7-oAnEDG1WwfZ5JhOpHjDxn62s\0BJ6pIZapeyXhNBDvO_JhJyFP9A\waf\.terraform\modules\owasp_top_10
drwxr-xr-x 1 Jamie 197121 0 Aug 14 15:31 .
drwxr-xr-x 1 Jamie 197121 0 Aug 14 15:31 ..
drwxr-xr-x 1 Jamie 197121 0 Aug 14 15:31 traveloka-terraform-aws-waf-owasp-top-10-rules-a0fc16d
ls -la /c/.terragrunt-cache/x7-oAnEDG1WwfZ5JhOpHjDxn62s/0BJ6pIZapeyXhNBDvO_JhJyFP9A/waf/.terraform/modules/owasp_top_10/traveloka-terraform-aws-waf-owasp-top-10-rules-a0fc16d/
total 30
drwxr-xr-x 1 Jamie 197121 0 Aug 14 15:46 .
drwxr-xr-x 1 Jamie 197121 0 Aug 14 15:46 ..
drwxr-xr-x 1 Jamie 197121 0 Aug 5 03:27 .github
-rw-r--r-- 1 Jamie 197121 114 Aug 5 03:27 .gitignore
-rw-r--r-- 1 Jamie 197121 452 Aug 5 03:27 CHANGELOG.md
-rw-r--r-- 1 Jamie 197121 3614 Aug 5 03:27 CONTRIBUTING.md
drwxr-xr-x 1 Jamie 197121 0 Aug 5 03:27 examples
-rw-r--r-- 1 Jamie 197121 11357 Aug 5 03:27 LICENSE
-rw-r--r-- 1 Jamie 197121 3707 Aug 5 03:27 README.md
For whatever reason the module isnt being downloaded as there is no main.tf.
If I run terraform init
in the infrastructure/waf
folder and ls -la .terraform/modules
the main.tf
is present.
I am seeing a similar issue the past couple of days but in my case, if I delete .terragrunt-cache it will work for about 1 run, then it will go back to complaining about unsupported arguments again.
Any update on this?
I am using a module from the registry and it is failing. Note: Running this in vscode bash shell.
Steps to reproduce
I verified the module and tf files were downloaded by going to the terragrunt cache folder.
If I just run terraform init in the path where the .tf files are it works.