How to test custom build of azurerm provider

I’ve followed the instructions in the readme here for building a small change to the provider. I have the binary correctly output to $GOPATH/bin/terraform-provider-azurerm now I want to test and see if my change fixes my problem.

Reading the following document it sounds like I should be able to run terraform init -plugin-dir=$GOPATH/bin but I get the following output

$ terraform init -plugin-dir=$GOPATH/bin

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/azurerm...

Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider
hashicorp/azurerm: provider was not
found in any of the search locations

- /home/jshare/go/bin

I’ve also tried copying the binary to . and to terraform.d/plugins/linux_amd64/ both of which the above document claim should be searched before downloading, but no success.

I feel like I’m missing something basic in the docs. Anyone able to point me in the right direction?

After reading the Makefile on the tutorial repository and supplementing with information from the CLI docs I’ve landed on the following command that seems to work.

cp ~/go/bin/terraform-provider-azurerm ~/.terraform.d/plugins/

I’m still open for input on whether this is the correct/recommended way to do manual testing of locally built providers.

1 Like