# How can I use modified provider at terraform?

**URL:** <https://discuss.hashicorp.com/t/how-can-i-use-modified-provider-at-terraform/45869>\
**Category:** Terraform\
**Created:** [October 21, 2022, 2:23am UTC](https://discuss.hashicorp.com/t/how-can-i-use-modified-provider-at-terraform/45869 "2022-10-21T02:23:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chan.ryoo](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/chan.ryoo/32/23974_2.png) [@chan.ryoo](https://discuss.hashicorp.com/u/chan.ryoo)\
**Post date:** [October 21, 2022, 2:23am UTC](https://discuss.hashicorp.com/t/how-can-i-use-modified-provider-at-terraform/45869/1 "2022-10-21T02:23:48Z")

</div>

Hello. Now I am trying to debug terraform opensource…  
I want to confirm `terraform-provider-aws` but this file is complile at linux\_amd64 folder as binary, so I couldn’t debug it.

So, I downloaded `terraform-provider-aws` open source, and changed some code.  
After that I changed it to plugin file using

`go build -buildmode=plugin -o terraform-provider-aws_v4.33.0_x5`

this commend.

And in ‘terraform’, I confirmed .terraform.lock.hcl file and understood that it uses aws provider version 4.33.0.

I checked my `terraform-provider-aws`’s version is 4.33.0

But it gives error message like this

```auto
│ Error: Required plugins are not installed
│ 
│ The installed provider plugins are not consistent with the packages selected in the dependency lock file:
│ - registry.terraform.io/hashicorp/aws: the cached package for registry.terraform.io/hashicorp/aws 4.33.0 (in .terraform/providers) does not match any of the checksums recorded in the dependency lock file
│ 
│ Terraform uses external plugins to integrate with a variety of different infrastructure services. To download the plugins required for this configuration, run:
│ terraform init

```

could you please tell me how to solve this problem??

I used `-lock` and `terraform force-unlock <lockID>` commend, but result didn’t changed

Or, how can I debug `terraform-provider-aws` by using `terraform` ??  
Thank you!!

---

<div class="post-metadata">

**Author:** ![jbardin](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jbardin/32/3325_2.png) [@jbardin](https://discuss.hashicorp.com/u/jbardin)\
**Post date:** [October 21, 2022, 12:49pm UTC](https://discuss.hashicorp.com/t/how-can-i-use-modified-provider-at-terraform/45869/2 "2022-10-21T12:49:33Z")

</div>

Hi @chan.ryoo,

You can get a lot more detailed information about provider discovery from the page: [Plugin Development - How Terraform Works With Plugins | Terraform | HashiCorp Developer](https://developer.hashicorp.com/terraform/plugin/how-terraform-works), and more specifically [CLI Configuration: Provider Installation](https://developer.hashicorp.com/terraform/cli/config/config-file#provider-installation) (I usually use the `dev_overrides` method, just note that this bypasses the `init` discovery mechanism, so it’s OK for `init` to fail even if setup correctly)

You also want to remove `-buildmode=plugin`, which is not used for this purpose.
