# 错误：计划输出超过最大允许大小 4 MB

- **ID:** `terraform/plan-output-too-large`
- **领域:** terraform
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

由于资源过多或状态数据过大，Terraform 计划文件超过 4 MB 的计划序列化限制。

## 版本兼容性

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

## 解决方案

1. ```
   通过使用 Terraform 模块或拆分为单独的配置来减少单个计划中的资源数量。例如，将大型 VPC 设置拆分为较小的模块。
   ```
2. ```
   使用 'terraform plan -out=plan.tfplan' 然后 'terraform show plan.tfplan' 查看计划，而不是依赖完整输出。
   ```

## 无效尝试

- **** — Increasing the timeout or retrying the plan does not reduce the plan size. (95% 失败率)
- **** — Splitting the configuration into multiple workspaces without reducing resource count still results in large plans. (75% 失败率)
