Open mbrookson opened 3 years ago
Unfortunately for now plugin doesn't have any features to support complex code structures, it just goes up in directories tree until .terraform
found.
It's a bit unclear for me how to properly support that, proper fix will require some configurations files or super-smart heuristics.
As workaround I could suggest symlinking .terraform
from environments/{env}/.terraform
to your project root.
Is that correct that you invoke any terraform
commands only in environments/{env}
directories?
@VladRassokhin Thanks for the reply.
Yeah that's correct, all terraform
is invoked via environments/{env}
.
Was wondering whether it would be viable to add to the Terrform settings in the IDE? There is a similar feature for SQL Resolution Scopes where you can tell the IDE where to look. Pressing the +
button in the below screenshot allows you to add a directory to the list. Could this also be used for telling this HCL plugin where to look for files?
Thanks for info, I'll think about possible solutions, though don't expect them quickly
Is there any update on this? I have the same issue and I will love to have this.
Since for know it will give me an error if I don't use the flag:
//noinspection MissingModule
Thank you for opening an issue. In this template paragraph text could be removed, however please retain headers.
Prerequisites
Installation details
[x] IDE version (
Help->About->Copy to Clipboard
) JetBrains Rider 2020.2.4 Build #RD-202.7660.16, built on September 30, 2020 Licensed to Pickr Limited / Matthew Brookson Subscription is active until January 4, 2021 Runtime version: 11.0.8+10-b944.34 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. .NET Framework 4.0.30319.42000 Windows 10 10.0 GC: ParNew, ConcurrentMarkSweep Memory: 1450M Cores: 8 Registry: debugger.new.debug.tool.window.view=true, ide.tree.horizontal.default.autoscrolling=false, performance.watcher.sampling.interval.ms=200, ide.borderless.tab.caption.in.title=false, ide.tooltip.showAllSeverities=true, show.diff.preview.as.editor.tab=true, light.edit.file.open.enabled=false, performance.watcher.unresponsive.interval.ms=1000, search.everywhere.settings=true, show.diff.preview.as.editor.tab.with.single.click=true, parameter.info.max.visible.rows=10, ide.win.file.chooser.native=true, vcs.log.show.diff.preview.as.editor.tab=true, search.everywhere.pattern.checking=false, ide.tooltip.initialDelay=0, ide.require.transaction.for.model.changes=false, ide.debug.in.title=true, rdclient.asyncActions=false Non-Bundled Plugins: Abc.MoqComplete.Rider, BashSupport, Batch Scripts Support, CMD Support, String Manipulation, com.fwdekker.randomness, com.wakatime.intellij.plugin, org.intellij.plugins.hcl, mobi.hsz.idea.gitignore, com.jetbrains.sh[x] intellij-hcl plugin version (
Settings->Plugins
) 0.7.10[x] Terraform version (
terraform -v
) 0.13.4Terraform Configuration Files
configuration/backend/main.tf
We have an
environments/{env}
directory which contains the entry point for our infrastructure per environment, therefore each directory has its own.terraform
directory created. We then call into our core configuration like soExpected Behavior
When using external modules from a registry, modules in sibling directories outside of the parent/child hierarchy are still discovered by the IDE.
Actual Behavior
When using external modules from a registry, even after running
terraform get
it still cannot locate the external module. The terraform program itself seems to work fine and the module is installed in.terraform
. I assume this is not working because the module code is stored in.terraform
which is outside of the parent/child hierarchy.Steps to Reproduce
See above example code
Perhaps this could be achieved by allowing module scopes/discovery paths to be a configurable setting for the plugin?