Skip to main content
Terraform

Terraform Tutorials

Master Infrastructure as Code with Terraform. Learn to provision, manage, and version cloud infrastructure across AWS, Azure, GCP and more.

The Complete Terraform Learning Roadmap — From Beginner to Expert

A structured 4-month Terraform learning plan with weekly goals, certification guidance for HashiCorp Terraform Associate 003, a skills checklist, career paths, and references to all 29 previous Terraform posts on Goel Academy.

Read article →

Top 50 Terraform Interview Questions for DevOps Engineers

50 Terraform interview questions with concise answers and code examples — covering beginner fundamentals, intermediate module and state patterns, and advanced topics like custom providers, testing, and scaling.

Read article →

Terraform Troubleshooting — Debug Logs, Crash Recovery, and Common Errors

A practical guide to debugging Terraform — from TF_LOG levels and crash recovery to fixing state locks, dependency cycles, provider auth failures, and slow plans.

Read article →

Migrating from CloudFormation and ARM Templates to Terraform

Step-by-step guide to migrating existing infrastructure from AWS CloudFormation and Azure ARM Templates to Terraform — covering automated tools, import workflows, parallel stacks, rollback strategies, and common pitfalls.

Read article →

Terraform at Scale — Monorepo vs Polyrepo, and State Blast Radius

Scaling Terraform across teams and hundreds of resources — monorepo vs polyrepo trade-offs, state blast radius management, Terragrunt for DRY configurations, and CI/CD patterns that keep large organizations shipping safely.

Read article →

Writing Custom Terraform Providers in Go

Build your own Terraform provider from scratch using Go and the Terraform Plugin SDK v2 — covering schema design, CRUD operations, acceptance testing, and publishing to the Terraform Registry.

Read article →

Terraform Drift Detection — When Reality Doesn't Match Your Code

Detect, diagnose, and fix Terraform drift — from scheduled CI plans and Terraform Cloud drift detection to prevention strategies like SCPs, Azure Policy, and read-only console access.

Read article →

Terraform Multi-Environment — Terragrunt, Workspaces, or Directory Structure?

Compare the three major approaches to managing multiple Terraform environments — workspaces, directory structure, and Terragrunt — with a comparison table, real examples, and guidance on when to use each.

Read article →

Terraform Cloud vs Self-Managed — Remote Execution and Governance

Compare Terraform Cloud, Terraform Enterprise, and self-managed setups — remote state, remote execution, Sentinel policies, cost estimation, team management, and when the paid features justify the price.

Read article →

Terraform Module Design Patterns — Composition Over Inheritance

Design Terraform modules that scale across teams — composition patterns, interface design, versioning with Git tags, registry publishing, and the anti-patterns that turn modules into unmaintainable monsters.

Read article →

Terraform State Surgery — Move, Remove, and Recover State

Master Terraform state surgery — move resources between modules, remove items without destroying them, recover corrupted state from backups, and use moved blocks for safe refactoring without downtime.

Read article →

Terraform Security — tfsec, Checkov, and Policy as Code

Scan your Terraform code for security misconfigurations using tfsec, Checkov, OPA, and Sentinel — catch public S3 buckets, open security groups, and unencrypted resources before they ever reach your cloud account.

Read article →

Terraform Testing — Validate, Plan, and Test Your Infrastructure Code

Test your Terraform code at every level — from static validation and plan assertions to integration testing with Terratest and the built-in terraform test framework — so bugs never reach production infrastructure.

Read article →

Terraform in CI/CD — Automated Plan, Apply, and Drift Detection

Automate Terraform with GitHub Actions, GitLab CI, and Atlantis — run plan on PRs, apply on merge, detect drift on a schedule, and keep your infrastructure pipeline as disciplined as your application code.

Read article →

Terraform Built-in Functions — The Complete Reference with Examples

Master Terraform's built-in functions — string, numeric, collection, encoding, filesystem, date, hash, IP, and type conversion functions with practical examples.

Read article →

Terraform Provisioners — When (and When Not) to Use Them

Understand Terraform provisioners — local-exec, remote-exec, and file. Learn when they're necessary, when to avoid them, and better alternatives like cloud-init and Ansible.

Read article →

Terraform Import — Bring Existing Infrastructure Under Control

Learn how to import existing cloud resources into Terraform state using terraform import, import blocks (Terraform 1.5+), and bulk import strategies for AWS, Azure, and GCP.

Read article →

Terraform on Azure — Resource Groups, VNets, and VMs

Provision Azure infrastructure with Terraform — from authentication and resource groups to virtual networks, NSGs, and Linux VMs — with a complete working example you can deploy today.

Read article →

Terraform Remote State with S3 and DynamoDB — Team Collaboration

Set up Terraform remote state with S3 backend, DynamoDB state locking, cross-project state references, and migrate from local to remote — everything your team needs to stop breaking each other's infrastructure.

Read article →

Build a Complete AWS VPC with Terraform — Step by Step

Build a production-ready AWS VPC from scratch with Terraform — public and private subnets across multiple AZs, internet and NAT gateways, route tables, security groups, and VPC endpoints.

Read article →

Terraform Workspaces — Manage Dev, Staging, and Production

Learn how Terraform workspaces let you manage multiple environments from a single codebase — when to use them, when to avoid them, and what the alternatives look like.

Read article →

Terraform Modules — Reusable Infrastructure Components

Learn how to build, consume, and version Terraform modules — from local child modules to the public registry — so your team stops copying and pasting infrastructure code forever.

Read article →

Terraform Expressions — Conditionals, Loops, and Dynamic Blocks

Master Terraform expressions including conditionals, count, for_each, for expressions, dynamic blocks, splat operators, and practical patterns for real-world infrastructure code.

Read article →

Terraform CLI — init, plan, apply, destroy, and import Explained

A complete guide to every essential Terraform CLI command, including init, plan, apply, destroy, import, fmt, validate, console, workspace, and state management.

Read article →

Terraform Data Sources — Query Existing Infrastructure

Learn how to use Terraform data sources to query existing infrastructure, look up AMIs, reference shared VPCs, and bridge the gap between managed and unmanaged resources.

Read article →

Terraform Resource Lifecycle — Create, Update, Destroy, and Taint

Learn how Terraform manages the lifecycle of infrastructure resources, including lifecycle meta-arguments, taint and replace strategies, and dependency management.

Read article →

Terraform Providers — AWS, Azure, GCP, and 3000+ More

Learn how Terraform providers connect your code to cloud platforms and services, how to configure them, manage versions, and use aliases for multi-region deployments.

Read article →

Terraform Variables and Outputs — Make Your Code Reusable

Master Terraform input variables, output values, locals, and variable precedence to write reusable, maintainable infrastructure code.

Read article →

Terraform State — Local vs Remote, Locking, and Why It Matters

Understand how Terraform state works, why it matters, and how to manage it properly with remote backends, locking, and best practices.

Read article →

Terraform Basics: Infrastructure as Code for Beginners

Get started with Terraform and learn how to manage your cloud infrastructure using Infrastructure as Code principles.

Read article →

Related Topics