Enable versioning for all existing Terraform states
Problem to solve
Versioning was added to Terraform states in #207347 (closed), and enabled for all new states. However, any states created beforehand will continue to use the old, single-version behaviour.
User experience goal
No interruption to Terraform functionality while the migration is ongoing - users should simply see updates begin to be stored as separate versions.
Proposal
Create an initial version for each state that has versioning disabled using the file currently stored, and flip the versioning_enabled
flag to signal that versions should be stored separately going forward.
Further details
- A version could be in use (locked) at the time of migration, in which case we should abort and try again after a delay.