Terraform updated from 0.11.11 to 0.12.13 but tfstate file is pointing to 0.11.11 and erroring out when deploying.
Error: Unable to Read Previously Saved State for UpgradeResourceState
There was an error reading the saved resource state using the current resource schema.
If this resource state was last refreshed with Terraform CLI 0.11 and earlier, it must be refreshed or applied with an older provider version first. If you manually modified the resource state, you will need to manually modify it to match the current resource schema. Otherwise, please report this to the provider developer:
flatmap states cannot be unmarshaled, only states written by Terraform 0.12 and higher can be unmarshaled
Terraform file:
terraform {
required_version = “0.12.31”
backend “s3” {
bucket = “portal-build-account-state”
dynamodb_table = “portal-build-account-state”
encrypt = true
key = “portalenv.tfstate”
region = “us-east-1”
}
}
provider “github” {
owner = local.github_org
version = “~> 4.0”
token = “token”
}
provider “aws” {
region = “us-east-1”
version = “3.76.0”
}
Thanks!