Post

Provider inconsistency is another nightmare. Each cloud provider implements Terraform differently. AWS provider works one way, Azure has its own special interpretation, GCP throws curveballs. "Multi-cloud" they promised. "Consistent experience" they said.

What we got was learning three different flavors of the same broken abstraction. My personal favorite error: "Provider produced inconsistent final plan." This is Terraform's way of saying "I have no idea what I'm doing, but it's definitely your fault.

The Import Circus deserves special mention. Need to import existing infrastructure? Hope you enjoy playing "guess the exact configuration that matches your existing resource." Get one attribute wrong? Start over.

But Here's The Real Issue: We're Using It Wrong Most Terraform disasters happen because we've bought into the myth that everything must be "Infrastructure as Code." This is like using a hammer for every job because someone told you "everything is a nail."

Here's what Terraform/OpenTofu is actually good at: Core Infrastructure - VPCs, subnets, security groups, load balancers. The foundational stuff that changes rarely and has clear dependencies.

Stateful Resources - Databases, storage buckets, DNS zones. Things you absolutely need to recreate identically if disaster strikes. Foundation Layer - IAM roles, policies, networking backbone. The plumbing that everything else depends on.

Configuration Management - Use Ansible, Salt, or good old bash scripts. Don't try to manage application configs through infrastructure tools. Secrets Management - Use dedicated secret stores, not Terraform state files. Your database passwords have no business being in a state file.

The Anti-Pattern Playbook: Stop over-modularizing everything. A simple aws_instance doesn't need to be wrapped in 3 layers of abstraction. Modules should solve real problems, not just follow "best practices" from blog posts.

Don't DRY yourself to death. Some repetition is good! Copy-pasting 3 similar resources is often cleaner than building a complex loop with conditional logic that nobody can debug at 3 AM. If you can't understand your own code in 6 months, you've gone too far.

Don't Terraform all the things. Your application code doesn't belong in Terraform. Your monitoring dashboards don't belong in Terraform. Your team's lunch orders don't belong in Terraform. Keep it focused on actual infrastructure.

Don't ignore blast radius. One monolithic Terraform state managing 500 resources across every environment is a ticking time bomb. Break it up by failure domains and operational boundaries, not by "logical separation" from some consultant's diagram.

The Sane Terraform Strategy: Start simple and stay simple. Write plain Terraform first. Add complexity only when you feel real pain, not because a blog post said you should. Test everything in disposable environments. Keep state files small and focused on related resources.

Embrace hybrid approaches. Use Terraform for the foundation, then use cloud-native tools for everything else. Don't force everything through one tool just for consistency's sake. Let each tool do what it does best.

Focus on operational reality. Optimize for debugging, not elegance. Prioritize clarity over cleverness. Plan for the 3 AM production incident when you're half-asleep trying to figure out why the apply failed. Document why you made decisions, not just what the code does.

The Industry Reality Check: The dirty secret is that most successful infrastructure teams use Terraform for maybe 20% of their actual infrastructure management. The other 80% is handled by specialized tools, scripts, and yes, sometimes even manual processes where that makes more sense.

0 reposts0 likes

The companies with the most reliable infrastructure aren't the ones with the most comprehensive Terraform configurations. They're the ones that picked the right tool for each job and didn't try to force everything into a single "Infrastructure as Code" paradigm.

The Bottom Line: Terraform and OpenTofu aren't bad tools - they're just overused tools. The real problem isn't the software, it's the industry's obsession with making everything "Infrastructure as Code" even when it makes operations more complex and fragile.

Sometimes the most professional thing you can do is tell your team that not everything needs to be in Terraform. Sometimes a bash script is the right answer. Sometimes clicking through the console is perfectly fine for that one-off resource.

Sometimes the "best practice" is knowing when to ignore the best practices. The goal isn't perfect Infrastructure as Code. The goal is reliable infrastructure that your team can actually maintain, debug, and operate without losing sleep.