Professional Documents
Culture Documents
Terraform Interview Questions
Terraform Interview Questions
Terraform Interview Questions
• Packer
• Cloud Foundry
• Ansible
• Kubernetes
3. What do you understand by Terraform Backends? What are the most recommended
Backends we should use?
• If the new users are still learning how to use Terraform, the default "local" backend is
most recommended, which requires no configuration.
• For the expert users, if they or their team are using Terraform to manage meaningful
infrastructure, the most recommended backend is the "remote" backend with
Terraform Cloud or Terraform Enterprise.
• Providers are plugins on that Terraform relies to interact with cloud providers, SaaS
providers, and other APIs.
• The Terraform configurations have to declare which providers they require so that
Terraform can install and use them.
• Kubernetes
• Turbonomic
• CloudBolt
• Azure Management Tools
• Morpheus
• CloudHealth
• Apptio Cloudability, more
• File Provisioner
• Chef Provisioner
• Habitat Provisioner
• Puppet Provisioner
• Local-exec Provisioner
• Remote-exec Provisioner
• Salt-masterless Provisioner
• Terraform Cloud for Business is very much similar to Terraform Cloud and it also
uses the same hosted environment as Terraform Cloud but with additional features for
larger teams.
• It gives some additional features such as single sign-on, audit logging, and the ability
to Terraform on-premise resources from the Cloud,more.
• terraform init
• terraform destroy
• terraform validate
• terraform apply
• terraform plan
• terraform refresh
• terraform graph
• The ".terraform" directory is a local cache where Terraform retains some files
required for subsequent operations against this configuration.
• Its contents are not intended to be included in version control.
• The Terraform backend is used to specify how an operation is executed and how the
state is loaded.
• It uses the 'local' backend by default. The abstraction enables remote execution, non-
local file state storage, etc.
20. What can you do to ignore duplicate resource errors during Terraform apply?
• You can delete those resources from Terraform code to stop its management.
• You can do a Terraform import of the resource and remove the code trying to recreate
them.
• You can delete those resources from the cloud provider (API) and recreate them using
Terraform.
• There is a way to lock the Terraform Module Versions. If the Terraform module
registry is being used as a source, then the 'version' attribute can be used in the
module in a configuration file of Terraform.
26. What are the main reasons for choosing Terraform for DevOps?
• It provides amazing support to almost all the popular cloud providers like AWS,
Azure, GCP, DigitalOcean, etc.
• It can easily manage the configuration of an immutable (dynamic) infrastructure.
• It provides an immutable infrastructure where configuration changes smoothly.
• It works on HCL (HashiCorp Configuration Language), which is very easy to learn
and understand.
• It is easily portable from one provider to another.
• Terraform D is a plugin used on most in-service systems and Windows. Terraform init
by default searches next directories for plugins.
Terraform Cloudformation
Cloudformation may be complicated if your
Terraform can work with various cloud
setup requires several cloud installations. It is
providers such as AWS, GCP, Azure
best for AWS resources such as EC2, S3
The state of Cloudformation is managed out-
Terraform saves the state of the infrastructure
of-the-box by CloudFormation, which
on a virtual machine or a remote computer.
prevents conflicting updates.