[x] Upgrade Terraspace: Are you using the latest version of Terraspace? This allows Terraspace to fix issues fast. There's an Upgrading Guide: https://terraspace.cloud/docs/misc/upgrading/
[x] Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on https://community.boltops.com
[x] Code sample: Have you put together a code sample to reproduce the issue and make it available? Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.
As stated in the docs the pass file folder "files" (either in modules or stacks) shall be used to place files that will be used from the terraform code e.g. for aws_instance user_data or provisioners. https://terraspace.cloud/docs/config/pass-files/
It's not working correctly.
When calling terraspace up mystack the provisioner or file-function cant find the file, even thought the cache structure is just fine, one can clearly see the files which work in a normal environment flawlessly.
Current Behavior
When put in module:
│ Error: Invalid function argument
│
│ on ../../modules/testmodule/main.tf line 9, in resource "aws_instance" "server":
│ 9: user_data = file("files/test.sh")
│
│ Invalid value for "path" parameter: no file exists at "files/test.sh"; this
│ function works only with files that are distributed as part of the
│ configuration source code, so if this file will be created by a resource in
│ this configuration you must instead obtain this result from an attribute of
│ that resource.
In a stack however all the files are copied without the need for any folder, then they are magically picked up on the root folder of the stack, but then i don't need the feature of file passing, that id like to use.
Checklist
My Environment
Expected Behaviour
As stated in the docs the pass file folder "files" (either in modules or stacks) shall be used to place files that will be used from the terraform code e.g. for aws_instance user_data or provisioners. https://terraspace.cloud/docs/config/pass-files/
It's not working correctly.
When calling terraspace up mystack the provisioner or file-function cant find the file, even thought the cache structure is just fine, one can clearly see the files which work in a normal environment flawlessly.
Current Behavior
When put in module:
│ Error: Invalid function argument │ │ on ../../modules/testmodule/main.tf line 9, in resource "aws_instance" "server": │ 9: user_data = file("files/test.sh") │ │ Invalid value for "path" parameter: no file exists at "files/test.sh"; this │ function works only with files that are distributed as part of the │ configuration source code, so if this file will be created by a resource in │ this configuration you must instead obtain this result from an attribute of │ that resource.
In a stack however all the files are copied without the need for any folder, then they are magically picked up on the root folder of the stack, but then i don't need the feature of file passing, that id like to use.
Code Sample
Not working:
Not Working: (This is module code)
Working: (This is module code)