terraform module_error ai_generated true

错误:模块未找到:模块 "vpc" 源 "terraform-aws-modules/vpc/aws" 在注册表中未找到

Error: Module not found: module "vpc" source "terraform-aws-modules/vpc/aws" not found in registry

ID: terraform/module-source-not-found

其他格式: JSON · Markdown 中文 · English
85%修复率
86%置信度
1证据数
2024-04-18首次发现

版本兼容性

版本状态引入弃用备注
Terraform v1.5.0 active
Terraform v1.6.0 active
Terraform v1.7.0 active

根因分析

指定的模块源在Terraform注册表中不存在,或版本约束与任何已发布版本不匹配。

English

The specified module source does not exist in the Terraform registry or the version constraint does not match any published version.

generic

官方文档

https://developer.hashicorp.com/terraform/language/modules/sources

解决方案

  1. Verify the module name and namespace in the Terraform registry: `terraform-aws-modules/vpc/aws` is correct; check for typos. Then run 'terraform init'.
  2. 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'

无效尝试

常见但无效的做法:

  1. Run 'terraform init' without any flags 95% 失败

    Init can only install modules if the source is valid; it won't fix a non-existent source.

  2. Use a local file path instead of the registry source 80% 失败

    The local path must contain the module; a random path won't work.

  3. Add a version constraint like 'version = "latest"' 90% 失败

    The module doesn't exist at all; no version constraint can fix that.