Error: Could not load plugin for terraform 0.14.3

746 Views Asked by At

We are getting below error for our provider

Error: Could not load plugin

Plugin reinitialization required. Please run "terraform init". Plugins are external binaries that Terraform uses to access and manipulate resources. The configuration provided requires plugins which can't be located, don't satisfy the version constraints, or are otherwise incompatible. Terraform automatically discovers provider requirements from your configuration, including providers used in child modules. To see the requirements and constraints, run "terraform providers". Failed to instantiate provider "registry.terraform.io/hashicorp/aws" to obtain schema: unknown provider "registry.terraform.io/hashicorp/aws" Authenticating with credentials from /root/.docker/config.json

although we have also replaced the provider

terraform state replace-provider -auto-approve registry.terraform.io/-/aws registry.terraform.io/hashicorp/aws 
terraform state replace-provider -auto-approve registry.terraform.io/-/external   registry.terraform.io/hashicorp/external
terraform state replace-provider -auto-approve registry.terraform.io/-/null   registry.terraform.io/hashicorp/null
terraform state replace-provider -auto-approve registry.terraform.io/-/random   registry.terraform.io/hashicorp/random
terraform state replace-provider -auto-approve registry.terraform.io/-/template  registry.terraform.io/hashicorp/template

apart from this we had also used required_providers but no luck

 required_providers {
        aws = {
        source = "hashicorp/aws"
        version = "3.49.0"
      }
    }
1

There are 1 best solutions below

0
On

I have followed the below steps.

  1. rm -rf ~/.terraform.d/plugins/registry.terraform.io/hashicorp/*
  2. terraform init

Hope this helps.