Skip to content

Documentation for state file versioning considerations #19290

Open
@edahlseng

Description

@edahlseng

I have a general question about how Terraform handles state file versions. I couldn't find this information anywhere in the online docs; I hope I haven't just missed it! Please point me in the right direction if I should be asking this somewhere else!

I notice that if I create a remote state file in one version of Terraform (e.g. on my local computer, using v0.11.8), and then try to run a plan/apply against that state file in a lower version of Terraform (e.g. as part of a CI build, using v0.11.1), Terraform complains with an error message along the lines of "this state file was created with a newer version of Terraform." This suggests to me that state files have an explicit version stored with them. I don't understand the full implications of this, however. For example, are we only limited with using older versions of Terraform? Can we always use a newer version of Terraform to operate on a given state file? Is there a process for upgrading the version of the state file? Would there be any benefit in doing such an operation, or is that a silly idea to even consider?

Metadata

Metadata

Assignees

Labels

coredocumentationplan-futureDocumentation work that will be considered for future planning cycles

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions