I want to load some external providers for acceptance testing. For Ex - Hashicorp TLS provider. Where should I specify this in config. I am getting error -
The following dependency selections recorded in the lock file are
inconsistent with the current configuration:
- provider Terraform Registry required by this configuration but no version is selected
resource.Test(t, resource.TestCase{
// keep the existing ProviderFactories, ProtoV5ProviderFactories, or ProtoV6ProviderFactories field
// add the below to also support the hashicorp/random provider in TestStep.Config:
ExternalProviders: map[string]resource.ExternalProvider{
"random": {
Source: "hashicorp/random",
Version: "3.3.2",
},
},
Steps: []resource.TestStep{/* ... */},
})
This will ensure that when the testing framework calls terraform init, it knows about the extra providers in the test step configurations. Hope this helps.