Upgrading to Terraform v1.0 - How to update terraform version in a remote state?

We are using S3 bucket to store state file and the version stored is 0.12.X
Now moving to terraform ver 1.0.5 . Local command of terraform init and plan works well… but when running in Gitlab pipeline … it complains about -

Error: Could not load plugin

How to update the terraform version in stored remote state without using apply command? Because the resources are already available and environment is too fragile and hence avoiding apply command.

Any workaround?


The version stored in the state is not something you need to upgrade, it only indicates the version which last saved the file for compatibility checks.

While possible, it does seem unlikely that going through the upgrade process from 0.12 has not needed to write any state whatsoever. Have you done through the steps in the upgrade guides?

As for the Error: Could not load plugin, that usually means there was a problem starting the provider and fetching the schemas, usually caused by needing to run terraform init, and would be accompanied by the message

Plugin reinitialization required. Please run “terraform init”