How I Use Terraform

Managing infrastructure by clicking through a web panel is a game of Russian roulette. It doesn’t matter if it’s AWS, Cloudflare, or any other platform. You are configuring something quickly, get distracted, leave a single checkbox unmarked in production, and everything breaks. The worst part isn’t even the failure itself; it’s the cold sweat of trying to remember exactly what you toggled inside that UI to revert it.

To avoid this, everything in my projects goes strictly through Terraform (IaC). If a resource is not explicitly defined in code, it simply does not exist.

The shift in how I work now is that 95% of that code is generated by AI. I no longer waste time writing repetitive HCL syntax by hand, but it always happens under strict, manual oversight.

1. What It Resolves: The Power of True Automation

When you provision servers, DNS records, or database instances by clicking buttons in a web dashboard, you are building in the dark. If you need to replicate that exact environment for a new project, spin up an identical staging branch, or recover from a catastrophic outage, you are completely at the mercy of human memory.

With Terraform, infrastructure becomes declarative and deterministic. The platform maintains a state file (terraform.tfstate) that acts as the single source of truth for what is actually deployed.

This changes the engineering paradigm entirely:

  • True Automation: An entire distributed architecture can be provisioned or torn down with a single terminal command.
  • Environment Consistency: Development, testing, and production environments are guaranteed to be exact mirrors of each other.
  • Idempotency: The engine compares your local code configuration against the live state and applies only the changes strictly necessary to achieve the target state. No surprises, no configuration drift.

2. The 95% Rule: Human Design, AI Scaffolding

Writing Terraform manifests is inherently structural and highly repetitive—defining blocks, mapping variables, and configuring providers. This makes it the perfect candidate for automation. AI models can output the boilerplate for almost any standard infrastructure component in seconds, entirely syntax-error free.

However, leveraging AI does not mean blindly trusting the output. The workflow is not hidden automation; it is controlled assistance.

Terraform and AI Workflow Reviewing generated resource manifests before execution.

Every single block of code is heavily audited. Nothing enters the codebase without being fully parsed and understood. To prevent model hallucinations or unintended resource provisioning, the absolute core of this workflow is the terraform plan command.

Before applying any change to production, running a plan provides an exact, human-readable diff of the infrastructure. It states precisely which resources will be created, destroyed, or modified in-place before a single live API call is executed. If that plan does not match the architectural blueprint in my head down to the millisecond, the code is discarded and refactored.

Terraform Code Snippet Automated module scaffolding with manual security enforcement at the Edge network layer.

Conclusion

Delegating boilerplate generation to AI doesn’t diminish engineering responsibility; it shifts the focus to where it actually belongs. It frees up mental bandwidth from writing repetitive code so you can focus entirely on high-level system design and scalability.

Eliminating human error from web consoles, while blending the speed of AI generation with the absolute safety of a terraform plan, ensures that infrastructure remains robust, predictable, and fully under control. No drama.