Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

template_dir can't handle subdirectories correctly on windows: open <filename>: The system cannot find the path specified. #73

Open
vroad opened this issue Oct 16, 2019 · 0 comments · May be fixed by #80

Comments

@vroad
Copy link

vroad commented Oct 16, 2019

Terraform Version

Terraform v0.12.12

  • provider.template v2.1.2

Affected Resource(s)

  • template_dir

Terraform Configuration Files

Only occurs with source directory that contains subdirectories

https://github.com/poseidon/terraform-render-bootstrap/blob/10d9cec5c256f4622712bf01448df1a2befc37c8/assets.tf#L18-L32

input  
└── manifests
    └── foo.txt
resource "template_dir" "manifests" {
  source_dir      = "input"
  destination_dir = "output"
  vars = {}
}

Debug Output

https://gist.github.com/vroad/5e29d07886bf66af4a613729465847b9
https://gist.github.com/vroad/8d0bc9b8f69c7a397599946b6d8d9852

Error: open output/dir\foo.txt: The system cannot find the path specified.

Only last path separator is \ (backslash), not / (slash). Might be related.

Panic Output

Expected Behavior

It should generate files in subdirectories as well.

Actual Behavior

No files generated and terraform stops with an error. Only occurs on windows. When running terraform from docker, it successfully generate files.

Steps to Reproduce

On powershell,

  1. mkdir input\manifests
  2. echo foo > input\manifests\foo.txt
  3. terraform apply

Important Factoids

I updated an example with minimal one.

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant