โ† Terraform Associate Exam Practice learning path
Terraform Associate Exam Practice ยท Module 5 of 10

State

How Terraform tracks real infrastructure.

๐Ÿ“– Key ideas

  1. State (terraform.tfstate) maps configuration to real resources and stores attributes.
  2. Remote backends (S3, Azure Storage, GCS, HCP Terraform) let teams share state safely.
  3. State locking prevents two people applying at the same time.
  4. Commands: terraform state list, show, mv and rm; terraform import or import blocks bring existing resources under management.
  5. State can contain secrets: restrict access and enable encryption.
๐Ÿ’ก Real-life example: Like a shop's stock register: it records what exists so the next stock check knows what changed.
State fileRecord mapping config to real resources
Remote backendShared location for state
State lockingPrevents concurrent changes
ImportBringing existing resources under Terraform