For Terraform plugins, the Terraform Core is a statically-compiled binary written in the Go programming language.
My question is does the client library always need to be written in Go?
What if we want to create a new provider for a target API, that doesn't have a Go client library?
CodePudding user response:
It looks like this article answers your question. The key paragraph being:
While it is possible to write a non-Go provider, thanks to Terraform's use of the gRPC protocol, it is harder than it may appear at first glance. Multiple packages, from encoders and decoders to Terraform's type system, would all need to be reimplemented in that new language. The Plugin SDK would also need to be reimplemented, which is not a trivial challenge. And the way non-Go providers would interact with the Registry, terraform init, and other pieces of the Terraform ecosystem is unclear.
Note that this would not necessarily prevent the creation of such a plugin because you could write a stub in Go that calls the library (CGO, via RPC etc).