Top Terraform Interview Questions and Answers (2021)
- What is Terraform?
- What are the key fetaures of Terraform?
- What are modules in terraform?
- What is main TF in terraform?
- What is module in terraform?
- How do you call a main TF module?
- What language does terraform use?
Q: What is Terraform?
Terraform is a tool for creating, updating, and versioning infrastructure securely and efficiently. Terraform is capable of managing both current and popular service providers, as well as custom in-house solutions. Configuration files notify Terraform which components are required to run a single application or an entire datacenter.
Q: What are the key fetaures of Terraform?
Below are the key fetaures of Terraform:
- Infrastructure as Code: A high-level configuration syntax is used to define infrastructure.
- Execution Plans: Terraform generates an execution plan during the "planning" phase.
- Resource Graph
- Change Automation
Q: What are modules in terraform?
A Terraform module is a set of Terraform configuration files contained within a single directory. Or a basic configuration with a single directory having one or more .tf file is a module. When Terraform commands are run directly from such a directory, it is referred to as the root module.
In this way, each Terraform configuration is a module. You may have a basic collection of Terraform configuration files like:
. |--- LICENSE |--- README.md |--- main.tf |--- variables.tf |--- output.tf
Q: What is main TF in terraform?
main.tf contains the primary configuration for your module. You can also build additional configuration files and arrange them in some helpful way for your project. Variable definitions for your module will be stored in variables.tf.
Take a look at our suggested post on Java :
Q: What is module in terraform?
A module is a container for several resources that are used in conjunction with one another. Modules can be used to construct lightweight abstractions, allowing you to define the infrastructure in terms of architecture instead of physical objects.
Q: How do you call a main TF module?
When you run terraform plan or terraform apply, the.tf files in your working directory combine to form the root module. This module will call other modules and bind them by transferring output values from one to input values from another.
Q: What language does terraform use?
Terraform configuration syntax is known as HashiCorp Configuration Language (HCL). It is designed to be both human-readable and editable, as well as machine-friendly. Terraform can also read JSON configurations for machine-friendliness.