I am trying to update an old tf statefile to post 0.13. However when I run terraform init
with 0.13, I get an error saying:
Error refreshing state: state snapshot was created by Terraform v1.0.2, which is newer than current v0.13.7; upgrade to Terraform v1.0.2 or greater to work with this state
And when I run terraform init
using 1.0.2, I get the below error:
╷
│ 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.
╵
I have updated the Terraform and Provider blocks so the “Terraform 0.13 upgrade process” should be complete
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
backend "s3" {}
}
provider "aws" {
region = "us-east-1"
assume_role {
role_arn = <redacted role>
session_name = <redacted session>
}
}
Is there a way to update the state file to post 0.13 using 1.0.2 or is there a way to downgrade the statefile version to 0.13 so I upgrade it, then move to 1.0.2?