Files
opentf/internal/plugin/grpc_provider.go
Andrei Ciobanu 4fc494ef8a Add POC for preconfigured providers
The idea is quite simple but the commited implementation is definitely
not in the final shape.
Right now, OpenTofu is handling the providers, from the installation,
sub-process mantainance, configuration and cleanup of it.
By doing so, this adds a lot of run time.
This commit is exploring on how to instruct OpenTofu to work with
providers pre-configured and hosted by a different process.
Therefore, a providers server has been created and can be found in
https://github.com/opentofu/hackathon-providers-server.

With this commit, was introduced the support of this new experimental
block:
terraform {
  // ...
  preconfigured_providers {
    playground = {
      source = "opentofu/playground"
      addr = "localhost:50051"
      protocol_version = 6
    }
  }
}

Having this configured, OpenTofu will just create a gRPC client to
communicate with the indicated addr.
The server is running the same protobuf schema and it's supposed to
function exactly the same as a provider mantained by OpenTofu itself.

One important thing to note, is that for every provider that is registered
in OpenTofu as pre-configured, the following calls should not be performed:
* ValidateProviderConfig
* ConfigureProvider

Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-06-05 17:25:32 +03:00

30 KiB