KEMBAR78
Terraform Interview | PDF | Amazon Web Services | Computer Science
0% found this document useful (0 votes)
18 views8 pages

Terraform Interview

Uploaded by

venkatreddy54313
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views8 pages

Terraform Interview

Uploaded by

venkatreddy54313
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Basic Terraform Interview Questions:

1. What is Terraform?
2. Why should you use Terraform over other tools?
3. What are the reasons for choosing Terraform for DevOps?
4. What do you understand by Terraform init?
5. Name some major competitors of Terraform.
6. What is the full form of Terraform HCL?

https://www.linkedin.com/in/sushant-sangam/
7. What are Providers and Resources in Terraform?
8. How does Terraform work?
9. What are the features of Terraform?
10. What do you mean by IaC?
11. Can you explain the concept of infrastructure as code (IaC) and how you've implemented it
using AWS CloudFormation or Terraform?
12. Describe the working of Terraform core.
13. What are the key features of Terraform?
14. What are the use cases of Terraform?
15. How to check the installed version of Terraform?
16. What are locals in Terraform and how are they used in modules?
17. What is a root module in Terraform?
18. How do you use the source argument in a module call?
19. What is a state file in Terraform?
20. What are the uses of the state file in Terraform, and why is it important?
21. How do you manage state in Terraform?
22. What is terraform state rollback?
23. How to modify Terraform state files?
24. What is state.tf in Terraform?
25. What is terraform.tfstate.backup files?
26. How do you manage tfstate file in Terraform?
27. If terraform.tfstate file is deleted, what can be done?
28. Explain the purpose of the terraform init command.
29. What is the Terraform plan?
30. What is the use of the terraform plan command?
31. What is the purpose of the terraform apply command?
32. What is a data source in Terraform, and how is it used?
33. Explain the terraform taint command.
34. What is the use of Terraform provider?
35. What do you understand by Terraform in AWS?
36. What is called terraform fmt?
37. Can Terraform be used for another cloud provisioning?

https://www.linkedin.com/in/sushant-sangam/
2
Intermediate Terraform Interview Questions:
38. What are the most useful Terraform commands?
39. How does Terraform help in discovering plugins?
40. What are the usages of Terraform CLI?
41. What are some most commonly used Terraform CLI commands?
42. Can I add policies to the open-source or pro version of Terraform enterprise?
43. What is the ".terraform" directory?
44. What are the Terraform modules?
45. What is a Terraform module and why are they important?
46. What is the use of Terraform modules?
47. Have you used any Terraform modules in your project?
48. How do you create a Terraform module?
49. How do you use a Terraform module in your configuration?
50. What are input variables in a Terraform module?
51. How do you define output values in a Terraform module?
52. How can you create and manage dependencies between modules in Terraform?
53. How do you version Terraform modules?
54. What are the ways to lock Terraform module versions?
55. How do you test Terraform modules?
56. What are meta-arguments in Terraform, and how are they used in modules?
57. What is the Terraform Registry and how do you use it?
58. What is Terraform's "module registry," and how can you leverage it?
59. What are some best practices for writing Terraform modules?
60. How do you manage module documentation?
61. What do you mean by Terraform Cloud?
62. Define null resource in Terraform.
63. Can Terraform be used for on-prem infrastructure?
64. What does the following command do?
65. List all the Terraform-supported versions.
66. What is the purpose of the terraform block within a module?
67. What is the functionality of the "terraform validate" command?

https://www.linkedin.com/in/sushant-sangam/
3
68. What are the differences between public and private modules?
69. Mention some of the version control tools supported by Terraform.
70. Can you explain the usage of the terraform import command?
71. What is the role of terraform import, and when would you use it?
72. How do you pass arguments to a VPC while using the terraform import command?
73. What are the prerequisites before importing a VPC in Terraform?
74. What is the significance of the output block in Terraform?
75. What are Provisioners in Terraform?
76. What is the usage of provisioners in Terraform?
77. How would you use a var.tf file in a Terraform configuration to define and manage
variables?
78. What are the different types of provisioners in Terraform, and how are they used?
79. What types of files and folders are created after running terraform init, and what are their
purposes?
80. How to rename resource name in terraform?
81. How do you change the name of an instance in terraform file without destroying it?
82. Why are you using Terraform for infrastructure management instead of using Boto3?
83. Where can you run Terraform commands from?

Advanced Terraform Interview Questions:


84. How would you recover from a failed apply in Terraform?
85. What do you mean by Terragrunt, list some of its use cases?
86. What steps should be followed for making an object of one module to be available for the
other module at a high level?
87. How do you ensure module compatibility across different Terraform versions?
88. What is the best way to store the Terraform state file?
89. Where can Terraform state files be stored, and what are the different places or storage
options available?
90. In AWS, where do you store the state file, and how do you manage it?
91. What are Terraform state locks, and why are they important?
92. What do you understand by Terraform Backends? What are the most recommended
Backends we should use?
93. What is a Remote Backend in Terraform?
94. What is a Tainted Resource?
https://www.linkedin.com/in/sushant-sangam/
4
95. Are callbacks possible with Terraform on Azure?
96. What are some major competitors of Terraform?
97. How to prevent Error Duplicate Resource?
98. Explain the workflow of the core terraform.
99. Explain the architecture of Terraform request flow.
100. Difference between Terraform and CloudFormation?
101. Differentiate between Terraform and Ansible?
102. What are the most useful Terraform commands?
103. Are callbacks possible with Terraform on Azure?
104. What is Terraform Directory?
105. Is history the same as it is on the web while using TFS API to provide resources?
106. What is a Private Module Registry?
107. What are the differences between root modules and child modules in Terraform,
and how are they used in infrastructure management?
108. Does Terraform support multi-provider deployments?
109. How is duplicate resource error ignored during terraform apply?
110. How do you structure a Terraform project with multiple modules?
111. How do you handle module updates and upgrades?
112. How do you handle module outputs in a multi-module environment?
113. How does Terraform handle resource changes in a running environment?
114. How do you manage state files for different environments in Terraform?
115. How do you pass multiple values to a module using maps and lists?
116. What are some of the built-in provisioners available in Terraform?
117. Tell us about some notable Terraform applications.
118. What are the components of Terraform architecture?
119. How do you perform automated testing in Terraform?
120. Define Resource Graph in Terraform.
121. Can you provide a few examples where we can use Sentinel policies?
122. What are the various levels of Sentinel enforcement?
123. How do you handle sensitive data in Terraform modules?
124. What is Terraform Core? Tell us some primary responsibilities of it.
125. How will you upgrade plugins on Terraform?

https://www.linkedin.com/in/sushant-sangam/
5
126. How will you control and handle rollbacks when something goes wrong?
127. How does Terraform handle rolling back changes?
128. How can you define dependencies in Terraform?
129. What is the external data block in Terraform?
130. What are the advantages of using Terraform's "count" feature over resource
duplication?
131. How do you provision infrastructure using Terraform?
132. What happens when multiple engineers start deploying infrastructure using the
same state file?
133. Which value of the TF_LOG variable provides the MOST verbose logging?
134. Which command can be used to preview the terraform execution plan?
135. Which command can be used to reconcile the Terraform state with the actual real-
world infrastructure?
136. What is the benefit of Terraform State?
137. What is the benefit of using modules in Terraform?
138. How do you refactor Terraform code into modules?
139. Can you explain the concept of "module composition" in Terraform?
140. What is Terraform D?
141. What are some best practices to manage terraform state file?
142. What are some of the latest Terraform Azure Provider factors?
143. What is Terraform Core? Tell us some primary responsibilities of it.
144. Where will you run the Terraform code on the remote or local machine?
145. What are the different degrees of Sentinel policing?
146. What is the difference between Terraform's declarative and imperative
approaches?
147. How do you handle complex infrastructure with Terraform?
148. How do you store the .tfstate file in S3?
149. Write Terraform code for an S3 bucket and attach a policy.
150. Write a Terraform code for EC2.
151. How do you create multiple EC2 instances in Terraform?
152. How do you write a Terraform script to create an autoscaling group?
153. How does Terraform differ from other IaC tools like Ansible, Chef, or Puppet?
154. What are Terraform workspaces, and when are they useful?
https://www.linkedin.com/in/sushant-sangam/
6
155. How do you restore your Terraform state file?
156. How do you debug issues within a Terraform module?
157. Can you give an example of a complex module you've written?
158. What are the benefits of using Terraform with CI/CD pipelines?
159. How do you upgrade Terraform versions in a project?
160. Describe how you can use Terraform with infrastructure deployment tools like
Ansible or Chef.
161. How to select availability regions using a static file in Terraform?
162. How do you manage credentials in Terraform?

Scenario-based Interview Questions:


163. A DevOps Engineer manually created infrastructure on AWS, and now there is a
requirement to use Terraform to manage it. How would you import these resources in
Terraform code?
164. You have multiple environments - dev, stage, prod for your application and you
want to use the same code for all of these environments. How can you do that?
165. A Junior DevOps Engineer accidentally deleted the state file, what actions/steps
should we take to address this issue?
166. During a critical system update, you discover that the Terraform state file, which
contains essential configurations and states for your application, has been lost. How would
you handle this situation to ensure minimal disruption and data integrity?
167. Your team is working on a project using Terraform to manage AWS infrastructure.
AWS has just released a new service that you want to integrate into your Terraform-
managed environment. How would you approach incorporating this new service into your
Terraform configuration, and what steps would you take to ensure that Terraform
supports and correctly manages this new service?
168. Your team is adopting a multicloud strategy and you need to manage resources on
both AWS and Azure using Terraform. How do you structure your Terraform code to
handle this?
169. There are some bash scripts that you want to run after creating your resources with
Terraform. How would you achieve this?
170. Your company is looking for ways to enable HA. How can you perform blue-green
deployments using Terraform?
171. Your company wants to automate Terraform through CI/CD pipelines. How can
you integrate Terraform with CI/CD pipelines?
172. If an S3 bucket was created through Terraform but someone manually added a
policy to it, how do you handle this situation using IaC?

https://www.linkedin.com/in/sushant-sangam/
7
173. Your infrastructure contains database passwords and other sensitive information.
How can you manage secrets and sensitive data in Terraform?
174. You have an RDS Database and EC2 instance. EC2 should be created before RDS.
How can you specify dependencies between resources in Terraform?
175. You have 20 servers created through Terraform but you want to delete one of them.
Is it possible to destroy a single resource out of multiple resources using Terraform?
176. Suppose you specify a count of 10 for VPCs in your Terraform script. How many
virtual machines (VMs) will be created as a result of this configuration?
177. You are tasked with migrating your existing infrastructure from Terraform version
1.7 to version 1.8. What kind of considerations and steps would you take?
178. You have executed the following Terraform commands in sequence: terraform init,
terraform plan, and terraform apply. Without running terraform destroy, is it possible to
execute terraform init again and subsequently run the other commands as needed? How
would you approach this situation?
179. What is the biggest issue you have faced with Terraform, and how did you resolve
it?

https://www.linkedin.com/in/sushant-sangam/
8

You might also like