hashicorp / terraform-plugin-mux

A router for Terraform's RPC protocol.
Mozilla Public License 2.0
34 stars 11 forks source link

Consider Consolidation into terraform-plugin-go #229

Open bflad opened 5 months ago

bflad commented 5 months ago

terraform-plugin-mux version

v0.15.0

Description

The creation of the terraform-plugin-mux Go module was a pragmatic, separate extension to the terraform-plugin-go ecosystem to enable provider developers to support multiple SDKs within a single logical provider. Later, functionality was added to enable the translation of protocol version 5 to version 6, so provider developers could opt into nested attribute support for new resource implementations but at the cost of only supporting more modern versions of Terraform (e.g. 1.x) since providers announce protocol support at the provider server level. The functionality in this Go module operates a low-to-the-protocol level, similar to that of terraform-plugin-go's provider server implementations.

While the separation of concerns and versioning between terraform-plugin-mux and terraform-plugin-go has the benefits of reducing friction for mux releases, there are a few considerations that were not clear or present when it was introduced:

The last point is the latest main driver for this considering this effort. Effectively and "safely" introducing protocol changes right now requires a dance of terraform-plugin-go and terraform-plugin-mux changes to prevent provider developers from needing to upgrade all their SDK dependencies at once, e.g.

Provider developers in this model receive 6 or 7 dependency updates.

Consolidating this Go module's functionality into terraform-plugin-go would simplify this process for both maintainers and consumers, since there will be less dependency updates to consider overall:

Provider developers in this model receive 3 or 4 dependency updates.

There are some tradeoffs however:

Proposal

Decide if this Go module needs to be separate anymore. If so --

The maintainers should also determine if its worth actively promoting the necessary code changes to official/partner providers in the ecosystem, since this cohort is relatively small and staying up to date with available protocol features is relatively high impact effort.

References