Infrastructure as CodeMarch 5, 2026· 7 min read

Terraform Best Practices for Azure & AWS

Indresh Pratap Singh
Indresh Pratap Singh
Founder & Cloud Solutions Architect
Share

Infrastructure as Code only pays off if it's maintainable. A tangled mess of Terraform is a different kind of debt — one that blocks every deploy and scares off new contributors.

First, treat state as a shared, protected resource. Remote state with locking is non-negotiable — on AWS use S3 + DynamoDB, on Azure use a storage account blob with leases. No local state, no drift.

Design modules around reusable, versioned units — not one module per resource. A good module hides provider complexity behind a small, well-documented interface that works the same on AWS and Azure.

Pin provider and module versions. Reproducibility beats novelty. Your infrastructure should build the same way in a year as it does today.

Run plan in CI on every PR. Human review is for architecture; machines should catch the formatting and diff errors. Approval gates on apply, automation on plan.

Indresh Pratap Singh
Written by
Indresh Pratap Singh

Founder of Krizia Technologies and Cloud Solutions Architect with 7+ years of experience across AWS, Microsoft Azure, and GCP. I design cloud solutions, build hospital management systems, and automate business workflows with AI and WhatsApp. I write about cloud architecture and automation that works in production — no hype.

Comments2

  • PS
    Priya Sharma
    2 days ago

    The rollback-first framing clicked for me — we've always treated rollback as an afterthought. Definitely stealing the 'rehearse until boring' line.

  • MC
    Marcus Chen
    1 week ago

    Great breakdown. The staging rehearsal point is exactly what separated our seamless migration from our nightmare one.

Leave a comment