Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default .terraformignore rules don't work on Windows #23311

Closed
Jaecen opened this issue Nov 7, 2019 · 2 comments · Fixed by #23398
Closed

Default .terraformignore rules don't work on Windows #23311

Jaecen opened this issue Nov 7, 2019 · 2 comments · Fixed by #23398
Assignees
Labels
backend/remote bug v0.12 Issues (primarily bugs) reported against v0.12 releases

Comments

@Jaecen
Copy link

Jaecen commented Nov 7, 2019

Terraform Version

Terraform v0.12.13

Terraform Configuration Files

n/a

Debug Output

n/a

Crash Output

n/a

Expected Behavior

When no .terraformignore file is present, executing a plan or apply on a Remote Backend CLI-drive run will ignore any .git and .terraform folders, excluding .terraform/modules, while building the slug to upload.

Actual Behavior

On Windows, .terraform and .git folders are included in the uploaded slug.

Steps to Reproduce

On a Windows machine with latest Terraform installed:

  1. Create a new Terraform Cloud workspace
  2. Create a Terraform configuration with a remote backend pointing at that workspace
  3. terraform init
  4. Copy a large file (100+ MB) into the .terraform folder
  5. terraform plan
  6. Watch your upload statistics and note how long it takes to upload
  7. Create a .terraformignore file with the following contents:
**\.git\**
**\.terraform\**
!**\.terraform\modules\**
  1. terraform plan
  2. Note how this upload is practically instant

Additional Context

I believe this is happening because the default .terraformignore uses forward slashes, but backslashes are required on Windows. If you create a .terraformignore file using forward slashes, you see the same behavior as if not using a .terraformignore at all. If you change it to backslashes, it works correctly.

References

n/a

@hashibot hashibot added backend/remote bug v0.12 Issues (primarily bugs) reported against v0.12 releases labels Nov 8, 2019
@pselle pselle self-assigned this Nov 14, 2019
@pselle
Copy link
Contributor

pselle commented Nov 14, 2019

@Jaecen Thanks for filing this report! This is definitely an oversight, and I appreciate you posting the current workaround (.terraformignore with the default rules) for any users looking for it. I'll get to work on fixing this.

@ghost
Copy link

ghost commented Mar 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend/remote bug v0.12 Issues (primarily bugs) reported against v0.12 releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants