terraform
module_error
ai_generated
true
Error: Module not found: module "vpc" source "terraform-aws-modules/vpc/aws" not found in registry
ID: terraform/module-source-not-found
85%Fix Rate
86%Confidence
1Evidence
2024-04-18First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| Terraform v1.5.0 | active | — | — | — |
| Terraform v1.6.0 | active | — | — | — |
| Terraform v1.7.0 | active | — | — | — |
Root Cause
The specified module source does not exist in the Terraform registry or the version constraint does not match any published version.
generic中文
指定的模块源在Terraform注册表中不存在,或版本约束与任何已发布版本不匹配。
Official Documentation
https://developer.hashicorp.com/terraform/language/modules/sourcesWorkarounds
-
85% success Verify the module name and namespace in the Terraform registry: `terraform-aws-modules/vpc/aws` is correct; check for typos. Then run 'terraform init'.
Verify the module name and namespace in the Terraform registry: `terraform-aws-modules/vpc/aws` is correct; check for typos. Then run 'terraform init'.
-
90% success If the module is private, add a module source with a Git URL: `source = "git::https://github.com/org/terraform-aws-vpc.git?ref=v3.0.0"` and run 'terraform init'
If the module is private, add a module source with a Git URL: `source = "git::https://github.com/org/terraform-aws-vpc.git?ref=v3.0.0"` and run 'terraform init'
中文步骤
Verify the module name and namespace in the Terraform registry: `terraform-aws-modules/vpc/aws` is correct; check for typos. Then run 'terraform init'.
If the module is private, add a module source with a Git URL: `source = "git::https://github.com/org/terraform-aws-vpc.git?ref=v3.0.0"` and run 'terraform init'
Dead Ends
Common approaches that don't work:
-
Run 'terraform init' without any flags
95% fail
Init can only install modules if the source is valid; it won't fix a non-existent source.
-
Use a local file path instead of the registry source
80% fail
The local path must contain the module; a random path won't work.
-
Add a version constraint like 'version = "latest"'
90% fail
The module doesn't exist at all; no version constraint can fix that.