Basic-Level Questions
What is Terraform and why is it used in DevOps?
Explain the difference between Terraform and other IaC tools like Ansible or CloudFormation.
What are providers in Terraform? Can you name a few commonly used ones?
What is the purpose of the Terraform state file?
How do you initialize a Terraform project?
Intermediate-Level Questions
What is the difference between Terraform modules and resources?
How does Terraform handle dependencies between resources?
Explain the difference between terraform plan and terraform apply.
What are Terraform workspaces and when would you use them?
How do you manage sensitive data (like secrets or passwords) in Terraform?
What is the difference between local state and remote state?
Advanced-Level Questions
How do you handle state file conflicts in a team environment?
What strategies do you use for Terraform code reusability across multiple environments?
Explain the concept of Terraform backend. Which backends have you used?
How do you perform Terraform upgrades when moving between major versions?
Can you explain Terraform’s lifecycle rules (create_before_destroy, prevent_destroy)?
How would you integrate Terraform with CI/CD pipelines?
What are Terraform provisioners and when should they be avoided?
How do you debug a failing Terraform deployment?
Scenario-Based Questions
Suppose you need to deploy the same infrastructure across AWS and Azure. How would you structure your Terraform code?
You notice that a resource was deleted manually in the cloud provider console. How would Terraform react?
How would you design a multi-region infrastructure using Terraform?
If your team is working on the same Terraform project, how do you ensure collaboration without state conflicts?
How would you implement blue-green deployment using Terraform?