hashicorp / terraform-plugin-go

A low-level Go binding for the Terraform protocol for integrations to be built on top of.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduce Protocol Server Capability for Optional GetProviderSchema RPC

bflad opened this issue · comments

terraform-plugin-go version

v0.18.0

Use cases

Terraform core is working on optimizing their overall memory utilization by supporting the ability to cache provider schemas per-type, rather than per-instance. This should cause a statistically significant drop in maximum resident size in Terraform environments running configurations with multiple provider aliases for larger providers, such as hashicorp/aws. The challenge is that not all provider implementations support all RPC operations without the historically upfront GetProviderSchema RPC, such as older versions of terraform-plugin-framework, which used the GetProviderSchema RPC to cache supported resource types for other RPCs.

Proposal

Update the plugin protocol to 5.4 and 6.4 with a new server capability to signal that the GetProviderSchema RPC is optional/skippable. Initial testing shows that terraform-plugin-sdk/v2@v2.27.0 and terraform-plugin-framework@v1.3.2 should be able to enable this capability once its exposed by this Go module. In terraform-plugin-mux, it should be able to front each existing RPC with a logic to call GetProviderSchema first if necessary for the underlying provider server.

References