In the process of building Terraform custom provider using terraform-plugin-framework
. After updating bunch of dependencies, hit the following snag:
> make build
env GOOS=`uname | tr '[:upper:]' '[:lower:]'` GOARCH=amd64 GO111MODULE=on go build -o terraform-provider-core_v3.0.0_x1 -gcflags="all=-N -l" -ldflags "-X=main.Version=3.0.0 -X=main.Build=1"
# github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema
vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/provider.go:508:9: cannot use NewGRPCProviderServer(p) (value of type *GRPCProviderServer) as tfprotov5.ProviderServer value in return statement: *GRPCProviderServer does not implement tfprotov5.ProviderServer (missing method GetMetadata)
make: *** [build] Error 1
Since I'm using Terraform Framework (instead of SDK), this reference should not even be there terraform-plugin-sdk/v2/helper/schema/provider.go
I tried removing ./vendor
directory and downloading all packages from scratch, but the issue still persists. Appreciate any help.
Finally found the solution for this issue. Apparently this happened due to Go dependency super weird situation, for more details see this framework issue.
And the way it gets resolved by manually updating version of
github.com/hashicorp/terraform-plugin-sdk/v2
package ingo.mod
to set asv2.30.0
like soKeep in mind, if you try to build the code right after manual version update of the package, it'll fail agin:
So, first thing you need to run is
go mod vendor
to properly update dependancies, and then, you can build the code.Hope this helps anyone who encounters such issue.