terraform
runtime_error
ai_generated
partial
Error: The plan output exceeds the maximum allowed size of 4 MB
ID: terraform/plan-output-too-large
80%Fix Rate
80%Confidence
1Evidence
2024-01-15First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.6.0 | active | — | — | — |
| 1.7.0 | active | — | — | — |
| 1.8.0 | active | — | — | — |
Root Cause
The Terraform plan file is too large due to many resources or large state data, exceeding the 4 MB limit for plan serialization.
generic中文
由于资源过多或状态数据过大,Terraform 计划文件超过 4 MB 的计划序列化限制。
Official Documentation
https://developer.hashicorp.com/terraform/cli/commands/planWorkarounds
-
85% success Reduce the number of resources in a single plan by using Terraform modules or splitting into separate configurations. For example, break a large VPC setup into smaller modules.
Reduce the number of resources in a single plan by using Terraform modules or splitting into separate configurations. For example, break a large VPC setup into smaller modules.
-
90% success Use 'terraform plan -out=plan.tfplan' and then 'terraform show plan.tfplan' to view the plan, instead of relying on the full output.
Use 'terraform plan -out=plan.tfplan' and then 'terraform show plan.tfplan' to view the plan, instead of relying on the full output.
中文步骤
通过使用 Terraform 模块或拆分为单独的配置来减少单个计划中的资源数量。例如,将大型 VPC 设置拆分为较小的模块。
使用 'terraform plan -out=plan.tfplan' 然后 'terraform show plan.tfplan' 查看计划,而不是依赖完整输出。
Dead Ends
Common approaches that don't work:
-
95% fail
Increasing the timeout or retrying the plan does not reduce the plan size.
-
75% fail
Splitting the configuration into multiple workspaces without reducing resource count still results in large plans.