Duplicate plugins

I am in the midst of migrating from TF 0.11 to 0.13. Here is part of my main.tf:

terraform {
  backend "s3" {
    key = "vpc-init/terraform.tfstate"
  }
  required_providers {
    aws = {
      source = "hashicorp/aws"
    }
    template = {
      source = "hashicorp/template"
    }
  }
}

and this is the output of terraform init:

Initializing the backend...
Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.
Initializing provider plugins...
- Finding latest version of -/local...
- Finding latest version of -/null...
- Finding latest version of hashicorp/null...
- Finding latest version of hashicorp/local...
- Finding latest version of hashicorp/template...
- Finding latest version of hashicorp/aws...
- Finding latest version of -/template...
- Finding latest version of -/aws...
- Installing hashicorp/template v2.2.0...
- Installed hashicorp/template v2.2.0 (signed by HashiCorp)
- Installing hashicorp/aws v3.11.0...
- Installed hashicorp/aws v3.11.0 (signed by HashiCorp)
- Installing -/template v2.2.0...
- Installed -/template v2.2.0 (signed by HashiCorp)
- Installing -/aws v3.11.0...
- Installed -/aws v3.11.0 (signed by HashiCorp)
- Installing -/local v2.0.0...
- Installed -/local v2.0.0 (signed by HashiCorp)
- Installing -/null v3.0.0...
- Installed -/null v3.0.0 (signed by HashiCorp)
- Installing hashicorp/null v3.0.0...
- Installed hashicorp/null v3.0.0 (signed by HashiCorp)
- Installing hashicorp/local v2.0.0...
- Installed hashicorp/local v2.0.0 (signed by HashiCorp)
The following providers do not have any version constraints in configuration,
so the latest version was installed.

To prevent automatic upgrades to new major versions that may contain breaking
changes, we recommend adding version constraints in a required_providers block
in your configuration, with the constraint strings suggested below.

* -/aws: version = "~> 3.11.0"
* -/local: version = "~> 2.0.0"
* -/null: version = "~> 3.0.0"
* -/template: version = "~> 2.2.0"
* hashicorp/aws: version = "~> 3.11.0"
* hashicorp/local: version = "~> 2.0.0"
* hashicorp/null: version = "~> 3.0.0"
* hashicorp/template: version = "~> 2.2.0"

Why am I downloading the exact same plugins from two different “registries” that are the same registry? Is there something in my code which is demanding “-/” instead of “hashicorp/”?

Hi @DrStrangepork,

You can run terraform providers to see where each of these dependencies is coming from.

If you do so, I expect you’ll see that these -/-prefixed items (legacy provider addresses) are coming from your existing state snapshot, because you’ve not yet run terraform apply to update its references to the new namespaced syntax.

In that case, you can run terraform apply after terraform init to cause Terraform to write those new-style addresses into a new state snapshot. If you’d rather not run terraform apply during upgrade, terraform refresh can also achieve a similar result although it does not pause for confirmation before writing the refreshed information to your configured backend.

However you do it, once you create a new state snapshot with Terraform 0.13 it will be written in the 0.13 format and thus no longer be compatible with Terraform 0.12. After that, a subsequent run of terraform providers should show no legacy-style provider addresses and so a subsequent terraform init will not try to install them.