This bit of code in a Terraform file:
templatefile("${path.module}/files/launch-template-user-data.tpl", {
...is parsed incorrectly, and claims the file doesn't exist on disk:
Call to function "templatefile" failed: no file exists at /files/launch-template-user-data.tpl.
The file actually does exist, and the Terraform template finds the file and applies correctly.
I confirm the same experience
| sofware | version |
| :---: | :---: |
| vscode | 1.39.1 |
| mauve.terraform | 1.4.0 |
I'm seeing similar behavior with the file() statement:
file("${path.root}/testfile.xml") returns
This object does not have an attribute named "root".
file("testfile.xml") returns
Call to function "file" failed: no file exists at testfile.xml.
If I hardcode the full path, it works.
vscode: 1.39.2
mauve.terraform: 1.4.0
Same issue as @voodevil , file is not parsing relative file paths correctly. If I make the file path relative to the root of the workspace it's fine but if it's relative to the file itself it fails. We only run terraform from the folder that contains the file, not the workspace root, so in our use case it should not give an error.
I can confirm the same issue
template = "${file("${path.module}/tasks/task_definition.json")}"
we don't run from the workspace root either and rely on ${path.module}
I can confirm the same as well
content = file("${path.module}/configs/ch2-asw-01.conf")
Throws the same error
Is there a way to disable the warning?
We just released v2.0.0-rc.1 of the extension. The main features include:
You can find additional information and specifics in the release notes and CHANGELOG.
With this release we expect that many of the prior issues and PRs are no longer relevant or have been addressed, and are therefore being closed. If you feel the action taken on an issue or PR is in error, please comment as such and we can figure out the appropriate way to address it.
We plan to add the final 2.0.0 release to the marketplace soon, but are actively seeking your feedback now on the release candidates. You can download the .vsix from the releases page and manually install it in VS Code to try it out.
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 context necessary to investigate further.
Most helpful comment
I'm seeing similar behavior with the file() statement:
file("${path.root}/testfile.xml")returnsfile("testfile.xml")returnsIf I hardcode the full path, it works.
vscode: 1.39.2
mauve.terraform: 1.4.0