When you try to execute a Terraform configuration in Terraform Enterprise (Atlas) you may get the error message:
Setup failed: Failed to copy slug dir: lstat /Users: no such file or directory
Cause:
The Git repository contains the .terraform/modules directory, and the Terraform Enterprise server cannot get the latest modules from GitHub.
Solution:
- Create a .gitignore file in the repository and add these lines:
*/.terraform/modules/ # Ignore DS_Store if working on a mac .DS_Store
- Delete the .terraform directory and push the changes to GitHub