Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix: ''Failed to instantiate provider "example" to obtain schema' : file does not exist' while building custom Terraform provider?

Tags:

terraform

I was trying to build a custom Terraform provider by following the tutorial on this site:

https://www.terraform.io/docs/extend/writing-custom-providers.html

I executed terraform init and that went well.

However, executing terraform plan gives the following error:

Error: Failed to instantiate provider "example" to obtain schema: exec: "C:\Users\myname\go\src\terraform-provider-example\terraform-provider-example": file does not exist

The terraform-provider-example file is present in the working directory where i am executing terraform plan

Has anyone faced this issue? Please help!

like image 325
pep8 Avatar asked Oct 13 '19 22:10

pep8


People also ask

How do I fix error provider configuration is not present?

Solution - Destroy module with reference to default providers. The error message provider["registry.terraform.io/integrations/github"] indicates the provider declaration is required. Adding the provider declaration back into the root module.

What is local provider in terraform?

The Local provider is used to manage local resources, such as files. Use the navigation to the left to read about the available resources. Note. Terraform primarily deals with remote resources which are able to outlive a single Terraform run, and so local resources can sometimes violate its assumptions.

Does terraform init modify state?

terraform init alone will never modify your state, but subsequently running terraform apply (and accepting the proposed changes) after you've upgraded the provider may cause the provider to upgrade the data stored for each existing object in a way that won't necessarily be compatible with earlier versions of that same ...


1 Answers

rename you provider with ".exe" suffix on windows environment

like image 111
xuzhang87 Avatar answered Sep 25 '22 03:09

xuzhang87