How do you implement agentic AI for automated Terraform state management?
Terraform state management agents monitor and maintain infrastructure state consistency and health. Configure agents with access to Terraform state files, backend storage systems, and workspace configurations. The agent detects state drift by comparing declared configurations against actual cloud resources. Implement automated state repair for common issues like orphaned resources and state lock conflicts. Monitor state file sizes and recommend state splitting for growing configurations. Implement state backup and versioning with automated retention management. Detect and alert on state conflicts in collaborative environments. Generate state health reports showing resource counts, drift status, and workspace organization. Support state migration between backends and workspace restructuring. Track state operation performance and optimize backend configurations for large state files.