Terraform0.13.5? 0.14.5?

I’m not very good at English.
So I can’t explain it well.

I am currently unable to execute the terraform plan.

Please help me.

terraform 0.14.5

❯ terraform version
Terraform v0.14.5

Your version of Terraform is out of date! The latest version
is 0.14.7. You can update by downloading from https://www.terraform.io/downloads.html

❯ terraform init -reconfigure

Initializing the backend...

Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.

Error: Invalid legacy provider address

This configuration or its associated state refers to the unqualified provider
"aws".

You must complete the Terraform 0.13 upgrade process before upgrading to later
versions.

terraform 0.13.5

❯ terraform version
Terraform v0.13.5

Your version of Terraform is out of date! The latest version
is 0.14.7. You can update by downloading from https://www.terraform.io/downloads.html

❯ terraform init -reconfigure

Initializing the backend...

Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.
Error refreshing state: state snapshot was created by Terraform v0.14.5, which is newer than current v0.13.5; upgrade to Terraform v0.14.5 or greater to work with this state

Hi @kiratenjin,

It sounds like some steps happened in the wrong order here and so the automatic upgrade process is blocked.

Since I can’t see your latest state snapshot I can’t say exactly what will work, but based on the error message I would suggest trying to run the following command with v0.14.5 to see if it is able to succeed:

terraform state replace-provider registry.terraform.io/-/aws registry.terraform.io/hashicorp/aws

If this command is able to succeed, it would change the “unqualified provider” that the error message refers to, so that it’s now a qualified provider as v0.14 requires. That is what the v0.13 upgrade process would’ve done automatically if you’d been able to complete it first, but hopefully you can now do it manually to get working again.

If you run into problems with that, please share the full error messages you see and I’ll try to think of some other options to try.

1 Like