Problem Statement
Explain the role of the 'terraform.tfstate' file and why it must be handled carefully.
Explanation
The 'terraform.tfstate' file stores the current state of infrastructure managed by Terraform.
It maps Terraform resources to their real cloud counterparts and tracks metadata such as resource IDs. Mishandling this file can cause Terraform to lose track of existing resources, potentially leading to accidental deletion or duplication.
For collaboration, it should be stored remotely using secure backends like AWS S3 or Terraform Cloud with proper locking and encryption enabled.
