Certainly!
Here are 30 basic Terraform interview questions
1. What is Terraform, and what problem does it solve?
2. How does Terraform differ from other infrastructure as code (IAC) tools like Ansible or Puppet?
3. What is the primary language used to write Terraform configuration files?
4. What are Terraform providers, and why are they important?
5. Explain the concept of a Terraform resource.
6. What is a Terraform module, and how does it help organize configurations?
7. What is the purpose of the `terraform init` command?
8. What does the `terraform plan` command do, and why is it useful?
9. How do you apply changes to your infrastructure using Terraform? What is the command for it?
10. What is the Terraform state file, and why is it crucial?
11. How can you secure sensitive data such as API keys or secrets in Terraform configurations?
12. Explain the difference between Terraform variables and outputs.
13. How do you use data sources in Terraform, and why are they important?
14. What is a Terraform workspace, and when would you use multiple workspaces?
15. What is the purpose of the `terraform.tfvars` file?
16. How can you destroy resources created by Terraform?
17. Explain the `terraform import` command. When is it useful?
18. What is remote state in Terraform, and why might you use it?
19. What is the `count` parameter in a Terraform resource block used for?
20. How can you manage the order of resource creation or dependency in Terraform?
21. What is the difference between the `for_each` and `count` arguments in a resource block?
22. Explain how to create and use Terraform modules.
23. What is the difference between the `provisioner` and `resource` blocks in Terraform?
24. How can you handle versioning of Terraform modules?
25. What is the purpose of the `depends_on` attribute in Terraform?
26. How does Terraform handle secrets management for providers like AWS?
27. Explain the concept of remote backends in Terraform.
28. What is the purpose of the `taint` and `untaint` commands in Terraform?
29. How can you create reusable configurations in Terraform?
Publ
ic
30. Can you use Terraform to manage resources in multiple cloud providers within the same
configuration? If so, how?
These questions should help you prepare for a basic Terraform interview. Depending on the job role
and level of expertise required, you may encounter more advanced questions as well.
Publ
ic