Failure trying to build test AWS provider locally

Hi folks,

I’m trying to build the Terraform AWS Provider so I can test the functionality in a particular pull request, in order to see if it fits my needs. I’m following the Provider Plugin Codebases documentation which instructs me to do the following for my first step:

go get github.com/hashicorp/terraform

This is failing with the following error:

# k8s.io/client-go/rest
../../../hmrc-gopath/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/rest/request.go:598:31: not enough arguments in call to watch.NewStreamWatcher
        have (*versioned.Decoder)
        want (watch.Decoder, watch.Reporter)
# github.com/coreos/etcd/clientv3
../../../hmrc-gopath/pkg/mod/github.com/coreos/etcd@v3.3.10+incompatible/clientv3/health_balancer.go:54:10: undefined: grpc.Address
../../../hmrc-gopath/pkg/mod/github.com/coreos/etcd@v3.3.10+incompatible/clientv3/health_balancer.go:60:18: undefined: grpc.Address
../../../hmrc-gopath/pkg/mod/github.com/coreos/etcd@v3.3.10+incompatible/clientv3/health_balancer.go:137:54: undefined: grpc.BalancerConfig
../../../hmrc-gopath/pkg/mod/github.com/coreos/etcd@v3.3.10+incompatible/clientv3/health_balancer.go:208:41: undefined: grpc.Address
../../../hmrc-gopath/pkg/mod/github.com/coreos/etcd@v3.3.10+incompatible/clientv3/health_balancer.go:383:34: undefined: grpc.Address
../../../hmrc-gopath/pkg/mod/github.com/coreos/etcd@v3.3.10+incompatible/clientv3/health_balancer.go:434:38: undefined: grpc.Address
../../../hmrc-gopath/pkg/mod/github.com/coreos/etcd@v3.3.10+incompatible/clientv3/health_balancer.go:470:56: undefined: grpc.BalancerGetOptions
../../../hmrc-gopath/pkg/mod/github.com/coreos/etcd@v3.3.10+incompatible/clientv3/health_balancer.go:470:82: undefined: grpc.Address
../../../hmrc-gopath/pkg/mod/github.com/coreos/etcd@v3.3.10+incompatible/clientv3/health_balancer.go:518:44: undefined: grpc.Address
../../../hmrc-gopath/pkg/mod/github.com/coreos/etcd@v3.3.10+incompatible/clientv3/health_balancer.go:577:22: undefined: grpc.Address
../../../hmrc-gopath/pkg/mod/github.com/coreos/etcd@v3.3.10+incompatible/clientv3/health_balancer.go:577:22: too many errors

As is probably incredibly obvious, I’m not literate in golang and am struggling to identify why this is failing. Grateful if anyone can point me in the right direction.

Many thanks,

Edd

Hi @eddgrant
there’s no need to build terraform itself if you want to build the AWS provider.

Hi @tbugfinder,

Thanks for your reply, do I not? I’ve actually got it working using the method described in the doc I linked to (although I’ve since realised that is out of date). I discovered that I was getting the issue I mentioned because somehow I was using go 1.14 rather than 1.15 when building.

To summarise the method I used:

  1. Build Terraform
  2. Build the Terraform Provider
  3. Execute the locally built Terraform binary, which seems to look in its own folder (or possible down the ${GOPATH}) for the provider binary. Having built the provider binary it appears right at the top of the path so uses the locally built provider.

I’m not sure if that’s still the preferred way of doing it? Would be grateful for any more up to date instructions if any exist.

Many thanks,

Edd

I didn’t build terraform for a provider build yet. So I don’t think so.

After building the provider (only), I configure .terraformrcwith dev_overrides.