Forensic investigations in Terraform focus on discovering what changed, who changed it, and when. They cut through the noise of complex infrastructure-as-code workflows. In practice, this means gathering every clue from state files, execution plans, audit logs, and version control commits. You examine drift. You verify Terraform plan outputs against actual cloud resources. You resolve inconsistencies between desired and real infrastructure.
Start with the state. This is Terraform’s single source of truth. Pull historical versions from your remote backend or repository. Compare states line by line. Look for added or missing blocks, updated parameters, or unexpected IDs. Each difference is potential evidence.
Next, trace execution. Review Terraform apply logs. Each apply tells you the timestamp, the operator, and the intent. Match these with your cloud provider’s activity logs. If a change appears in the cloud but not in the Terraform plan, you found a manual modification. That’s a red flag and a lead to follow.