State and change tracking

Terraform state records the relationship between configuration and managed objects. State can contain sensitive data, so protect it with appropriate access controls, encryption

Terraform state records the relationship between configuration and managed objects. State can contain sensitive data, so protect it with appropriate access controls, encryption, and a suitable backend for team use.

List resources recorded in the current state

This reads the state associated with the selected workspace and backend.

terraform state list

Static example · not executed

Case study

Scenario

A teammate changes a resource directly in a cloud console, outside Terraform. The configuration and live resource may now differ.

Task

What should the team do before applying another change?

Explanation / example

Review the current configuration, inspect the state and plan, understand the out-of-band change, then decide whether to update configuration or reconcile the resource. Do not apply blindly.

Knowledge check

Why protect Terraform state?

Pick an answer to check.