Data Engineering

Terraform - Infrastructure as Code

Providers, resources, state, modules, variables, outputs, plan/apply, workspaces, backends

20 interview questionsยท
Senior
1

What is Terraform and what is its main advantage over manual infrastructure configuration?

Answer

Terraform is an Infrastructure as Code (IaC) tool developed by HashiCorp that allows defining and provisioning infrastructure declaratively via configuration files. Its main advantage is reproducibility: the same configuration always produces the same result, eliminating human errors and enabling infrastructure versioning like code.

2

What is the role of a provider in Terraform?

Answer

A provider is a plugin that allows Terraform to interact with a specific platform (AWS, GCP, Azure, etc.). It translates Terraform resources into API calls to the target service. Each provider must be configured with necessary credentials and exposes the available resource types for that platform.

3

What is the difference between a resource and a data source in Terraform?

Answer

A resource creates and manages an infrastructure element (creation, modification, deletion), while a data source allows reading information about existing resources without modifying them. Data sources are useful for referencing elements created outside Terraform or by other configurations.

4

What is the purpose of the terraform.tfstate file?

5

Which command should be run to see the changes Terraform will make without applying them?

+17 interview questions

Master Data Engineering for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free