>DevOps Interview KB

Terraform Interview Questions

22 questions

Terraform interview questions on provider versioning and the dependency lock file, workspaces versus separate state files, state management (drift, locking, splitting monoliths, sensitive data, backup/recovery), and module design — the kind of state-file and provider-behavior subtleties that only show up after running Terraform against real, shared infrastructure.

Related technologies:AWSTerraform

What would make you choose a private Terraform module registry over Git-tag-based module sourcing, or vice versa?

IntermediateTerraform6 min

Your team has copy-pasted the same VPC Terraform configuration into six different repositories. Design a module structure and versioning strategy to fix that.

IntermediateTerraform10 min

A production database was created manually through the AWS console years ago — how would you bring it under Terraform management without recreating it?

IntermediateTerraform7 min

terraform init fails with a provider checksum mismatch after a teammate on a different OS committed the lock file — what's happening?

IntermediateTerraform6 min

How would you deploy the same Terraform resource type to multiple AWS regions within a single configuration, using provider aliases?

IntermediateTerraform6 min

Should you use Terraform workspaces or separate directories/state files to manage dev, staging, and production — what's the actual trade-off?

IntermediateTerraform7 min

How would you make it structurally difficult for someone to accidentally run terraform destroy against a production state?

IntermediateTerraform6 min

terraform plan fails with Error acquiring the state lock — how do you diagnose whether it's a genuine concurrent run or a stale lock?

IntermediateTerraform6 min

A Terraform pipeline that worked yesterday suddenly fails today with no code changes — how does an unpinned provider version cause this?

IntermediateTerraform6 min

What's the difference between state drift and a genuine configuration change in Terraform, and how does -refresh-only help distinguish them?

IntermediateTerraform6 min

What's the difference between terraform state rm and just deleting a resource block from configuration — when would you use state rm specifically?

IntermediateTerraform6 min