Skip to main content

[Spacelift.io] Terraform State Rollback Guide: Step-by-Step Recovery

·157 words·1 min

I’ve written a blog post on using Terraform State Rollback:

You sit down at your desk one morning and trigger a terraform plan command to see what changes Terraform will make to your infrastructure. To your horror, you see the following error:

$ terraform plan
│ Error: Unsupported state file format
│ The state file could not be parsed as JSON: syntax error at 
│ byte offset 7805.

Every Terraform practitioner’s nightmare is a corrupt state file, but it can happen despite your best intentions.

If you have followed best practices for your Terraform state backend, you will have implemented state file versioning, which enables you to recover a previous state version.

In this blog post, you will learn how to perform a rollback to a previous state in Terraform, follow a walkthrough of how to perform a rollback, and learn best practices around state rollback operations with Terraform.

Read more at spacelift.io

Mattias Fjellström
Author
Mattias Fjellström
Cloud architect · Author · HashiCorp Ambassador · Microsoft MVP

Related