Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Terraform Interview Questions and Answer – Set 1

terraform-interview-questio

External data sources must return information in what format?

  • A. XML
  • B. HTML
  • C. JSON
  • D. YAML

Ans: C. JSON

Which of the following is an example of Source Control Management software?

  • A. Jenkins
  • B. Visual Studio Code
  • C. Docker
  • D. Git

Ans: D. Git

Why would you use a partial configuration for a backend?

  • A. So that you can store your AWS credentials in the configuration
  • B. To make it simpler to change the backend storage type to a new service
  • C. So that the remainder of configuration can be defined the variables
  • D. To allow backend configuration data to be defined at runtime

Ans: D. To allow backend configuration data to be defined at runtime

What environment variable lets Terraform know it’s running in an automation context?

  • A. TF_AUTO_YES
  • B. TF_IN_AUTOMATION
  • C. TF_AUTOMATION
  • D. TF_AUTOMATION_TRUE

Ans: B. TF_IN_AUTOMATION

What is special about the default workspace?

  • A. It is removed when you create your first workspace.
  • B. It cannot be deleted.
  • C. You cannot select it.
  • D. It is named after the main configuration file.

Ans: B. It cannot be deleted.

What are the four common components of Configuration Management systems?

  • A. Get, Test, Set, Put
  • B. Authorization, Accounting, Auditing, and Access
  • C. Normalization, Comparison, Accounting, and Validation
  • D. Identification, Control, Accounting, and Verification

Ans: D. Identification, Control, Accounting, and Verification

Which Ansible command executes a playbook?

  • A. ansible-run-playbook
  • B. ansible-run
  • C. ansible-execute
  • D. ansible-playbook

Ans: D. ansible-playbook

What is the purpose of running the terraform init command?

  • A. Init will download the required plugins and modules for the configuration.
  • B. Init is an optional command to configure aliases.
  • C. Init will remove any existing resources from previous deployments.
  • D. Init will create new configuration files for you to populate.

Ans: A. Init will download the required plugins and modules for the configuration.

What does the import command do?

  • A. Imports a text file containing values to be used in the configuration
  • B. Imports an existing, unmanaged resource into the Terraform configuration
  • C. Creates a new Terraform configuration for unmanaged resources
  • D. Imports the settings from a previous Terraform installation

Ans: B. Imports an existing, unmanaged resource into the Terraform configuration

What type of request does the HTTP data source use?

  • A. PUT
  • B. POST
  • C. LIST
  • D. GET

Ans: D. GET

What command is being deprecated in favor of workspaces?

  • A. Production
  • B. Environment
  • C. Posture
  • D. Staging

Ans: B. Environment

Which option tells Terraform to use a local directory for plugins?

  • A. -plugin-dir=
  • B. -plugin-local=
  • C. -plugin-source=
  • D. -init-dir=

Ans: A. -plugin-dir=

What format does a rendered template take?

  • A. Map
  • B. String
  • C. JSON
  • D. List

Ans: B. String

Why would you use the option ‘-input=false’ when running terraform init?

  • A. It disables the use of variable files for input.
  • B. It ensures that Terraform only generates output.
  • C. It prevents Terraform from import files.
  • D. It prevents Terraform from prompting the user for input.

Ans: D. It prevents Terraform from prompting the user for input.

What format are ansible files written in?

  • A. JSON
  • B. HTML
  • C. YAML
  • D. XML

Ans: C. YAML

What is one benefit of using an immutable deployment?

  • A. Instances are never patched or upgraded in-place.
  • B. Instances and infrastructure are never redeployed.
  • C. It offloads all work to configuration management software.
  • D. Images are generalized and configured after the instance is created.

Ans: A. Instances are never patched or upgraded in-place.

Where can you find official modules to use with Terraform?

  • A. You must create your own
  • B. On the provider’s website
  • C. You have to request them from Hashicorp
  • D. On the Terraform module repository

Ans: D. On the Terraform module repository

In the import command, what do the ADDR and ID fields represent?

  • A. ADDR is the Terraform identifier; ID is the provider identifier.
  • B. ADDR is the name of the key; ID is the value of the key.
  • C. ADDR is the loopback address; ID is the static IP address.
  • D. ID is the Terraform identifier; ADDR is the provider identifier.

Ans: A. ADDR is the Terraform identifier; ID is the provider identifier.

How is the source for a template defined?

  • A. On the Terraform website
  • B. Using a map generated by Terraform
  • C. By pulling from GitHub
  • D. Either in-line or from a file

Ans: D. Either in-line or from a file

What command must be run to configure the backend in Terraform?

  • A. terraform backend
  • B. terraform fmt
  • C. terraform plan
  • D. terraform init

Ans: D. terraform init

Rajesh Kumar
Follow me