Terraform interview question

How would you recover a corrupted or lost Terraform state file?

Scenario Asked in DevOps Engineer · Cloud Engineer · Site Reliability Engineer (SRE) interviews

Members can save this page, take notes and track progress. See membership · Sign in

Summary

If the backend has versioning (S3 bucket versioning), restore the previous state version. If not, rebuild state by running terraform import for every resource the configuration manages. Prevention is better: always enable versioning on the state backend.

Keep reading with a membership

The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.

See plans and free trial Already a member? Sign in

More Terraform questions

← All Terraform questions

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake