# 错误：下载模块失败：模块 "vpc"（路径：modules/vpc）源 "github.com/terraform-aws-modules/terraform-aws-vpc?ref=v5.0.0" 不是有效的模块源

- **ID:** `terraform/terraform-module-source-invalid`
- **领域:** terraform
- **类别:** module_error
- **验证级别:** ai_generated
- **修复率:** 95%

## 根因

模块源地址使用了不支持的格式或存在拼写错误，例如 Git 仓库缺少 'git::' 前缀。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Terraform v1.5 | active | — | — |
| Terraform v1.6 | active | — | — |
| Terraform v1.7 | active | — | — |

## 解决方案

1. ```
   Use the correct Git source format: 'git::https://github.com/terraform-aws-modules/terraform-aws-vpc.git?ref=v5.0.0'.
   ```
2. ```
   Use the Terraform Registry address: 'terraform-aws-modules/vpc/aws' with version constraint.
   ```

## 无效尝试

- **** — Terraform requires explicit scheme prefixes for non-HTTP sources; GitHub URLs without 'git::' are treated as HTTP, which fails. (80% 失败率)
- **** — Terraform expects a full URL with scheme; omitting 'https://' leads to an invalid source error. (70% 失败率)
- **** — Relative paths only work for local modules; remote modules require a full URL or registry address. (90% 失败率)
