Terraform Interview Questions

Terraform Interview Questions | Freshers & Experienced

  • Calvin
  • 02nd Dec, 2019

Q1. What is Terraform?

Terraform is a popular tool to manage service providers, and for creating, modifying and versioning infrastructure securely and efficiently. It adequately generates an execution plan to reach the desired state and then execute it to build the desired infrastructure. Along with that, it is also capable to tell which changes can be applied to execution plans for better performance.

Low-Level components such as storage, networking, etc. and high-level components such as SaaS features, DNS entries, etc. are also managed by the infrastructure Transform.

Q2. Enlist major features of Terraform?

The major features of Terraform are:

  • Execution plans: High-level configuration syntax is used to describe the Infrastructure. This shows the blueprint of the datacenter that needs to be versioned. In addition, infrastructure can be re-used and shared.
  • Resource Graph: Terraform build infrastructure efficiently by creating the graph of all the resources and identify the non-dependent resources to modify them.
  • Change Automation: Infrastructure can apply complex changes with the minimum human interaction. As, terraform described an execution plan and resource graph previously, therefore you will know what changes will be made by Terraform and in which order, thus avoids maximum human errors.

Q3. In which programming language Terraform is written?

Terraform supports plugin model and plugins are issued as Go binaries. Technically, Plugins can also be written in another language, but all plugins preferred Go. With the use of high-level configuration language HCL( Hashicorp Configuration Language), it enables the users to provide a data center infrastructure.

Q4. What is use of Terraform CLI? Enlist few major command.

Terraform is controlled very easily with the command-line interface (CLI). The CLI is a well-mannered command-line application that takes subcommands such as "apply" or "plan". If there is an error, in any case, the CLI returns the non-zero exit status. If you want to view a list of commands supported by Terraform, run terraform with no arguments.

Common Terraform Commands are:

  • Apply: builds or changes infrastructure.
  • Console: Interactive console for Terraform interpolations.
  • destroy: Destroy Terraform-managed infrastructure.
  • env: Workspace management
  • fmt: Rewrites config files to canonical format
  • get: Download and install modules for the configuration
  • graph: Build a visible graph of Terraform resources Import: existing infrastructure into Terraform
  • Init: Initialize a Terraform working directory
  • output: Read output from a state file plan: Generate and show an execution plan validate: Validates the Terraform files
  • version: Prints the Terraform version
  • Workspace: Workspace management

Q5. What is a provider in Terraform? Enlist some Terraform Providers.

A provider is basically liable for exposing resources and understanding of API interactions.

Some Terraform providers are:

  • IaaS services: Examples are Alibaba Cloud, AWS, GCP, Microsoft Azure, OpenStack.
  • PaaS services: Examples are Heroku.
  • SaaS services: examples are Terraform Cloud, Cloudflare, DNSimple.

Q6. For what provisioners are used in Terraform?

Provisioners can be used to prepare servers or other infrastructure objects for service. It models specific actions on the local machine as well as on remote machines.

Q7. Enlist some Built-in Provisioners available in Terraform?

Below is the list of some Built-in provisioners in Terraform:

  • chef Provisioner
  • file Provisioner
  • habitat Provisioner
  • local-exec Provisioner
  • puppet Provisioner
  • remote-exec Provisioner
  • salt-masterless Provisioner

Q8. What are Modules in Terraform?

A module in Terraform is a container for several resources that are used together. The root module is compulsory for every terraform that includes resources mentioned in the .tf files.

Q9. What is Terraform cloud? Enlist few features provided by it?

Terraform Cloud is an application that let the teams use the Terraform together. It runs in a reliable environment and includes easy access to shared state and secret data. It provides access controls for adopting changes to infrastructure and a private registry for sharing terraform modules.

Features of the Terraform cloud are:

  • Audit logging
  • SAML single sign-on.

Q10. How to check installed version of Terraform?

To check the installed version of Terraform, use the below command:


 terraform [-version] [-help]  [args]

About Author :

  • Author of Terraform Interview Questions

    Calvin Carlo

    Calvin is a Senior web developer, a Javascript enthusiast, and a technical writer. He is very interested in learning new technologies and writing technical blogs on It. He loves playing Cricket, watching Hollywood action movies and is big fan of Michael Douglas.

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.