Introduction
When working on Windows with a volume mounted only as a folder, not a drive letter, the
terraform init
command will fail with the error EvalSymlinks: too many links
.Problem
The
terraform init
command fails, which prevent Terraform from being able to perform additional operations such as plan and apply.Prerequisites (if applicable)
- Windows
- Terraform for Windows, either 32 bit or 64 bit
- One of the following:
- A secondary drive or other type of volume mounted only as a folder. That is, there is no drive letter such as
D:
assigned to the drive - A OneDrive folder
Cause
- During
terraform init
, Terraform creates symlinks - Terraform is developed using the Go programming language, and uses the standard Go library for resolving symlinks
- The standard Go library for resolving symlinks depends on the volume on which the symlink is created having a drive letter, such as
D:
.
Overview of possible solutions (if applicable)
Solutions:
-
Create a drive letter mount in addition to the folder mount for the volume.
-
Open Computer Management
-
Select Disk Management
-
Right click on the volume that is currently only mounted with a folder
-
Select Change Drive Letters and Paths
-
Add a drive letter
-
- Use the Linux AMD64 version of Terraform with the WSL on Windows
Outcome
Once a drive letter is added to the volume's mount points, the
terraform init
command in a folder on that volume will succeed.