One thing I've been thinking about lately is how AI can help with Terraform without turning infrastructure management into a "let the LLM generate some HCL and hope for the best" exercise.
Generating Terraform configuration from a natural-language prompt is becoming relatively easy. The harder part is dealing with infrastructure that already exists:
Understanding the current state and repository structure.
Detecting and handling infrastructure drift.
Making sure generated changes actually pass terraform validate and terraform plan.
Applying existing architecture and security policies.
Keeping pull requests, reviews and human approval in the loop.
At Inditex Tech, we've been working on this problem with Kumoss, an open-source project that explores a developer-first approach to AI-assisted infrastructure management.
The idea is to use specialised AI agents to help with infrastructure changes, while keeping Terraform/OpenTofu as the source of truth for validation and planning.
A few interesting aspects of the approach:
Changes are generated in a dedicated Git branch.
Terraform/OpenTofu validates the configuration and generates the plan.
Drift is reconciled without blindly reverting changes already present in the environment.
Compliance checks and organisational policies are part of the workflow.
Applying infrastructure changes remains an explicit, authorised human action.
We recently published a technical article explaining the architecture and some of the engineering decisions behind it.
Article: https://medium.com/@InditexTech/managing-ai-assisted-cloud-infrastructure-with-an-open-source-developer-first-workflow-66a005b9b508
Kumoss is released under Apache 2.0.
I'm curious about how other Terraform users approach this:
Would you be comfortable introducing an AI agent into your Terraform workflow if it could generate changes and plans, but couldn't apply anything without human approval?
And more importantly, what would be your biggest concern: state management, drift, security, compliance, or trusting the generated plan?
Interested in hearing how the community sees this evolving.