Terraform: TF 0.12 can't read TF 0.13 remote state

Created on 26 Jun 2020  路  3Comments  路  Source: hashicorp/terraform

If some state has been touched by TF 0.13, it can no longer be used as remote state by a project using TF 0.12. Planning fails with:

Error: state snapshot was created by Terraform v0.13.0, which is newer than current v0.12.26; upgrade to Terraform v0.13.0 or greater to work with this state

When 0.12 came out, it was very useful that TF 0.11 could read TF 0.12's state. This made it possible to upgrade gradually if one's infrastructure was split into multiple state files.

Are there plans to support reading TF 0.13 state from TF 0.12?

documentation v0.13

All 3 comments

Hi @jbergknoff-rival,

We're not planning to continue that practice for future releases: it was a special exception for Terraform 0.12 because the upgrade effort from 0.11 to 0.12 was significant enough that we invested considerable extra effort to improve flexibility in the upgrade path, but it won't be practical for us to backport _every_ change to the state format to prior releases moving forward.

Instead, I think you'll be required to follow the same strategy as had been required for Terraform releases prior to 0.12: upgrade the "leaf" configurations to 0.13 first, and then work inwards through your dependency tree so that a configuration which produces remote state is upgraded to 0.13 only after all of its consumers are upgraded to 0.13.

I'm going to label this as "documentation" as a prompt to mention this in the 0.13 upgrade guide.

@apparentlymart We still have same problem with the state created by 0.13, may I know when or which version this practice will be removed ?

Error refreshing state: state snapshot was created by Terraform v0.13.4, which is newer than current v0.13.3; upgrade to Terraform v0.13.4 or greater to work with this state

We have now released Terraform versions 0.12.30 and 0.13.6, both of which allow reading remote state from all versions of Terraform at least through 1.0. That is, users of Terraform 0.12.30 and 0.13.6 will be able to access remote state written by other versions of Terraform including 0.11, 0.12, 0.13, and 0.14.

For more details, see the full changelogs:

https://github.com/hashicorp/terraform/blob/v0.12.30/CHANGELOG.md
https://github.com/hashicorp/terraform/blob/v0.13.6/CHANGELOG.md

Was this page helpful?
0 / 5 - 0 ratings