Terraform State Managing Terraform state files and remote backends. State Basics Terraform state tracks resource mappings and metadata. Local State Remote State State Commands Remote Backends S3 Backend Terraform Cloud Azure Backend State Locking Prevents concurrent modifications: Import Resources Workspaces Best Practices Enable State Locking Always use state locking to prevent concurrent modifications. Encrypt State Separate State Files Use different state files for different environments: Backup State Never Edit State Manually Always use commands. ---