Member-only story

Recovering Lost Terraform State File for Accidental Deletion or Corruption

Always learning
3 min readDec 14, 2024

What is Terraform?

Terraform, a powerful Infrastructure as Code (IaC) tool, has transformed how organizations manage their cloud resources and infrastructure.

Terraform state is a critical component that tracks deployed resources and their configurations.

This state is lost or corrupted, it can pose significant challenges in infrastructure management.

What is Terraform State?

Terraform state records all resources it creates and manages, capturing their current attributes and relationships.

This information enables Terraform to make informed decisions regarding resource creation, modification, or deletion during subsequent runs.

Think of Terraform state as a map of your infrastructure, facilitating Terraform’s understanding of the existing state and effective orchestration of changes.

Where is Terraform State Stored?

  1. Local Backend
  2. Remote Backends

In the local backend, the state resides in a local file within your project directory. While suitable for smaller projects or personal use, it has limitations concerning…

--

--

Always learning
Always learning

Written by Always learning

கற்றுக் கொள்ளும் மாணவன்...

No responses yet