Closed sharkwouter closed 4 years ago
I just tested it again, the behaviour is the same on Linux.
I finally found documentation about this: https://www.terraform.io/docs/extend/writing-custom-providers.html#building-the-plugin
Hi @sharkwouter! Sorry the docs for this were not well-linked.
It looks like the user-facing docs for this are currently more detailed than the developer-facing docs. That set of docs is linked from the section you found, but only in a very subtle way (via the word "sideloaded", which is not a word we use anywhere else in the docs). I think there's room for improvement on the docs organization for this, so I'm going to reopen it and label it that way so that we can improve on this in the future.
hashicorp/terraform#16325 is related, yeah?
Hi @paultyng!
The most recent meaning of this issue was representing possible improvements to the "Building the Plugin" section of the extend docs, which live in the hashicorp/terraform-website repository rather than in the hashicorp/terraform repository.
Did you move this issue back over here with a different intended change in mind? :thinking:
The docs in this area could use some fixes potentially to make this clear, but the naming is called out. This may need updating again somewhat with the provider source changes coming in future versions (see https://github.com/hashicorp/terraform/pull/23843 among other issues), but we can revisit the docs once that is live.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform Version
Terraform Configuration Files
Debug Output
Here is the git with the output for the "terraform init" command: https://gist.github.com/sharkwouter/9db1cd20d1331b069bad90e5749f3c0f
Expected Behavior
I manually added a provider I'm working on to the ~/terraform.d/plugins directory. I was expecting terraform to be able to load it.
Actual Behavior
Terraform did not load the provider.
Steps to Reproduce
go build -o terraform-provider-gridscale-1.0.0-darwin-amd64
terraform init
in the shell.Additional Context
I've tested this with different compiles on Mac, Windows and Linux. I was able to reproduce this on all of them.
Changing the name of the provider file to
terraform-provider-gridscale
makes Terraform able to load the file. The following filenames would prevent the provider from being loaded:I have also tried the putting the provider in the
plugins/darwin_amd64
directory on Mac andplugins/windows_amd64
directory on Windows. This did not change the result.So, to summarize the issue: Mac and Windows are not able to load a customer provider when the filename is not
terraform-provider-providername
. I was not expecting this to be the case, especially not when the filename is set when the provider is compiled.References