Problem: When you see below error on your terraform runs
[ERROR] eval: *terraform.EvalDiff, err: rpc error: code = ResourceExhausted
desc = grpc: received message larger than max (4797537 vs. 4194304)
Error is ResourceExhausted desc = grpc: received message larger than max (4207558 vs. 4194304)
, where the max is 4MB
Cause:
This does not have to do with Docker, memory (RAM) or any other system constraints
(local or on TFC/E). Instead, this is an error due to an underlying hardcoded 4MB limit in the gRPC message
size for messages sent to and from the provider plugin.
At this time there is no way to exceed this 4MB limit.
Solution:
The feature update to increase the size to 256MB has been implemented in terraform-plugin-go v0.6.0 and is used by the terraform-plugin-sdk. However, this update has not been adopted by the provider plugins yet.
In the mean time, to avoid this problem, you'll need to refactor your terraform configuration - such that your resource and state data is smaller than 4MB.
Supporting documentation:
-
https://github.com/hashicorp/terraform-plugin-go/blob/main/CHANGELOG.md#060-january-18-2022
-
https://github.com/hashicorp/terraform-plugin-go/commit/ecf4b08e80b4802f89f59d2196d368325de6c3d6