# 错误：无效的 required_providers 块：重复的 required_providers 块

- **ID:** `terraform/invalid-required-providers-block`
- **领域:** terraform
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 95%

## 根因

同一模块中存在多个 required_providers 块，这是 Terraform 不允许的。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.5.0 | active | — | — |
| 1.6.0 | active | — | — |
| 1.7.0 | active | — | — |

## 解决方案

1. ```
   将所有提供者需求合并到根模块中的单个 required_providers 块中。删除任何重复的块。
   ```
2. ```
   如果使用 Terraform 1.5+，在单个块中使用 'required_providers' 属性，合并所有条目。
   ```

## 无效尝试

- **** — Merging the blocks with incorrect syntax still results in a duplicate block error. (90% 失败率)
- **** — Adding a required_providers block inside a submodule does not fix the root module; the error is per module. (80% 失败率)
