From Modules to Intelligence: The Next Step in Terraform

There’s something I never thought I would say—but today, I proposed an architecture that challenged one of my own long-standing beliefs.

For years, working with large enterprises and global companies, I was one of the main advocates for Terraform standardization through reusable modules. The reasoning was clear: consistency, reusability, governance, and reduced cognitive load.

And to be fair—all of that is still true.

But today, I caught myself questioning something fundamental:

Why should we hardcode standards into modules… if AI can generate them on demand?

The Shift That Feels Uncomfortable (But Real)

This is not about complexity or capability. Terraform modules still work—and work well. But the context has changed.

We are no longer operating in a world where engineers manually write everything, standardization must be enforced through static abstractions, and refactoring is expensive and slow.

Today:

  • AI can generate Terraform configurations instantly
  • MCP and provider integrations are already available
  • Agents can enforce best practices dynamically
  • Refactoring can be automated at scale

So the question becomes: Are modules solving a problem that no longer exists in the same way?

From Modules → Providers + Intelligence

What I proposed is simple—yet controversial. Instead of:

Interface → Module → Provider

We move toward:

Interface → Provider (guided by AI)

Your “interface” still exists, but instead of calling a module, it directly interacts with providers, with AI ensuring best practices, security constraints, naming conventions, and resource configurations.

In other words: Standardization moves from code… to intelligence.

“But My Environment Is a Mess…”

Good. Because this model actually embraces that reality.

It doesn’t matter if you have 10 repos or 1,000, each following a different pattern, or naming conventions are inconsistent. We are no longer dependent on manual normalization.

Instead: AI agents analyze, apply patterns, refactor continuously, and validate outcomes. The key difference? Your company policies and governance rules live in the agent’s context—not hardcoded in modules. This means policies are enforceable at scale without being a bottleneck. When security or compliance rules change, you update the agent’s guidelines once, and it applies everywhere instantly.

The focus shifts from “Is the code standardized?” to “Is the outcome correct and validated?”

From an SRE perspective, this aligns perfectly with Error Budget Management and Release Engineering. Rather than investing heavily upfront in perfect module design, you’re allowing controlled variation—validated continuously—and optimizing dynamically.

⚠️ The Trade-Off (This Is Important)

This approach does not remove discipline—it shifts it. If before you needed strong module design, now you need strong validation systems.

Without that, this becomes chaos. You must have:

  • Continuous validation pipelines
  • Policy enforcement (OPA, checks, guardrails)
  • Observability over infrastructure
  • Clear definition of “correct state”

AI can generate—but you must verify. This is Monitoring and Automation working together—machines generate at scale, humans validate patterns, systems improve continuously.

How to Start (Practical Approach)

Don’t rewrite everything. Start small:

1. Define Your “Golden Rules” — Naming conventions, tagging standards, security requirements, cost constraints. These become AI instructions, not module constraints.

2. Introduce an AI Layer — Use agents (Claude Code, etc.), provide structured prompts, connect with providers via MCP or SDKs.

3. Add a Validation Loop (Critical) — Terraform plan checks, policy-as-code, cost estimation, security scans.

4. Enable Continuous Refactoring — Let AI revisit existing code, normalize differences automatically, improve over time instead of enforcing upfront.

Final Thought

We are not removing structure. We are relocating where structure lives—from static modules to dynamic intelligence.

And maybe the biggest shift is this: Today, suffering with manual standardization is optional.

Whether we like it or not, AI is no longer a tool—it’s becoming part of your infrastructure architecture.

Cheers,

Douglas Mugnos

MUGNOS-IT 🚀

guest
0 Comentários
Mais Velhos
Mais Novos Mais Votados
Inline Feedbacks
Veja todos comentários
0
Gostaria muito de saber sua opinião!x