Chapter 2 of 7 · HashiCorp Terraform Infrastructure Engineer Professional

Terraform State and Backend Operations

Remote backends, remote state, drift, state inspection and safe version upgrades.

  • 3topics
  • 16 minfast track
  • 2diagrams and exhibits

Topics in this chapter

Take them in order, or jump to the one you need.

  1. 1Remote Backends and Remote StateTerraform Professional 002: backend block rules, partial configuration, state migration, S3 locking, the cloud block and…Diagram5 min
  2. 2Managing State, Drift and InspectionTerraform Professional 002: detect drift with refresh only mode, keep or revert the change, use moved and removed blocks and…Diagram5 min
  3. 3Dependency Chains and Terraform UpgradesTerraform Professional 002: find what blocks an upgrade with terraform providers and graph, then move Terraform versions through…6 min

About this chapter

What this chapter covers

State and backend operations are about keeping Terraform's record of your infrastructure shared, accurate and readable as versions change. In production, a mistake here can replace live resources or lock a team out of its state.

The chapter has three parts: configuring remote backends and sharing data through remote state, managing and inspecting state while remediating drift, and finding dependency chains before upgrading Terraform across environments.

Questions are single-answer and multiple-answer ("Pick the 2 correct responses below") multiple choice, mostly scenarios and configuration to read. There are no exhibits.

How the topics fit together

Remote backendshared and locked stateInspect statewhat Terraform believesRemediate driftstate versus realityDependency chainswhat an upgrade touchesUpgrade versionsone environment at a time

The backend decides where state lives. Inspecting state tells you what Terraform believes, drift work reconciles that belief with reality, and a clean state is what makes an upgrade safe.

  • Backend questions ask what a backend block may contain, what init does after a change and how locking behaves.
  • Remote state questions ask what terraform_remote_state exposes and what access it requires.
  • Drift questions ask whether to keep or revert a change made outside Terraform.
  • Inspection questions ask which command shows a resource, a raw snapshot or JSON output.
  • Upgrade questions ask what blocks an upgrade and what order is safe.
Exam tip

Before picking a state command, decide what must change: the state record, the real object or the configuration. Most wrong options change the wrong one of the three.

How to use these pages

Each topic page has the same shape, so you can skim for what you need.

  • What it is: the idea in plain words.
  • How it works: the mechanism, with tables and examples.
  • What to remember for the exam: the facts to memorize and how questions are phrased.
  • Common mistakes: the classic traps.
  • Check yourself: three questions to test your understanding.

Ready for more practice?

The full HashiCorp Terraform Infrastructure Engineer Professional question bank has 600 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by HashiCorp. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.