Executing "terragrunt plan" from Visual Studio code gives the below error in Windows 10:
Running command: terraform init -backend-config=region=eu-west-2 -backend-config=bucket=bucket-name" -backend-config=dynamodb_table=lock-table -backend-config=encrypt=true -backend-config=key=ec2/terraform.tfstate
Initializing the backend...
Successfully configured the backend "s3"! Terraform will automatically use this backend unless the backend configuration changes.
Initializing provider plugins...
Error: Failed to install provider
Error while installing hashicorp/aws v3.36.0: mkdir .terraform/plugins/registry.terraform.io/hashicorp/aws/3.36.0/windows_amd64: The filename or extension is too long.
[terragrunt] 2021/05/19 15:39:20 Hit multiple errors: exit status 1
The proper fix is here:
git config --system core.longpaths trueHow to fix "Filename too long error" during git clone
Thanks Rubens for suggesting using TERRAGRUNT_DOWNLOAD environment variable. I'm able to work around this problem.
Here are the complete steps in terragrunt:
set TERRAGRUNT_DOWNLOAD=C:\\.terragrunt-cache
terragrunt init
Then copy or move C:\\.terragrunt-cache content to the .terragrunt-cache in my project (better clean up the folder first)
from cmd, unset TERRAGRUNT_DOWNLOAD and call apply
set TERRAGRUNT_DOWNLOAD=
terragrunt apply
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With