Plugin can't find modules with Terraform 1.1.x
See original GitHub issueSince I upgraded from Terraform v1.0.10 to v1.1.3 I found that the plugin is unable to find the standard terraform registry modules, hence the autosuggest doesn’t work anymore
I believe that this is due to a change in the modules.json generated, causing the plugin to fail the match between the Source
value in the code with the Source
value in the json file.
The observed change in modules.json is the following:
modules.json from Terraform v1.0.10
...
"Source": "terraform-aws-modules/vpc/aws",
...
modules.json from Terraform v1.1.3
...
"Source": "registry.terraform.io/terraform-aws-modules/vpc/aws",
...
As a workaround, I had to modify all my modules to point to the same full path registry.terraform.io/terraform-aws-modules/xxx
which is not ideal, but at least I can work with it
Prerequisites
- [ x ] Ensure you have latest version of plugin installed
- [ x ] Search for possible issue duplicates
Installation details
- [x ] IDE version PyCharm 2021.3.1
- [ x ] intellij-hcl plugin version 7.14
- [x ] Terraform version (
terraform -v
)
Terraform v1.1.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.72.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.2.0
+ provider registry.terraform.io/hashicorp/external v2.2.0
+ provider registry.terraform.io/hashicorp/helm v2.4.1
+ provider registry.terraform.io/hashicorp/kubernetes v2.7.1
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/hashicorp/tls v3.1.0
+ provider registry.terraform.io/terraform-aws-modules/http v2.4.1
Expected Behavior
The plugin doesn’t show any warnings
Actual Behavior
The plugin shows a warning “Cannot locate module locally: Unknown reason” and the auto-complete doesn’t work
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
- Install terraform v1.1.3
- run
terraform init -upgrade
to refresh the modules.json file
Issue Analytics
- State:
- Created 2 years ago
- Reactions:79
- Comments:10
Top GitHub Comments
@VladRassokhin - Can this be prioritised please? 4+ months for this is kind of ridiculous
Same here, downgrade works. You can accept the suggested action, it will create
.terraform/modules
, the warning disappears and autocomplete works. But it would be much nicer if the plugin would be just detect.terraform/modules
in the project root. Now all my submodules have a.terraform
directory.