Terraform is an Infrastructure as code tool developed by Hashicorp. It has the ability to connect with the cloud providers like AWS, GCP, and AZURE. In this blog post, you will see the Top 30 Terraform Interview questions asked at Beginners and Advanced Levels. All the questions are framed with AWS. The same can be expected either with GCP or AZURE.
- What is the role of Terraform in automating the infrastructure deployments?
- Give an example of how will you automate the Infrastructure in Terraform?
- What is the difference between Infrastructure as a Service and Infrastructure as a Code?
- What is the difference between a provider and a resource in Terraform?
- What information a state file contains?
- What is the difference between current and desired state information?
- Where does the current and desired state information is maintained?
- Give one example of a variable in Terraform? Explain the usage of variables?
- What is the difference between Locals and Variable?
- How Terraform is different compared to Ansible?
- When to use count and count index?
- What are the steps involved in deploying a resource from Terraform?
- If your infrastructure is on AWS, then in what scenario you will choose Terraform compared to AWS Cloudformation?
- What is Terraform Configuration Language?
- What is the difference between Terraform Plan and Terraform Apply commands?
- What are Locals in the Hashicorp configuration language?
- How do you output a resource configuration from Terraform?
- How to apply rollback in Terraform?
- What is the significance of “plugins” in the terminology of Terraform? Which plugins did you use in the project?
- How to upgrade a Terraform Plugin?
- How do you accommodate changes in the state file if multiple people want to work on the same file?
- How to apply locks for a state file?
- In how many ways, a resource can be destroyed?
- How do you activate a third-party provider?
- If a change is done manually after the deployment from Terraform, how Terraform manages it in the next run?
- What command is used to display the contents of a state file?
- How to log the output of a terraform plan or apply command to a text file for further debugging purpose?
- Explain how Modules are used in Terraform?
- What is a provisioner in Terraform? Explain briefly how do you implement remote-exe and local-exec provisioner?
- What is the difference between an attribute and a variable?
- Explain about Terraform Workspace?
- Let’s say we have created few resources in Terraform, Now we need to update the resources with few modifications, How do you achieve this Terraform?
- What is the significance of Tainting the resource
I hope these questions helped you to get an overview of the questions asked. Please comment below if you are interested to know the answers as well.