Dashboard

Learn faster. Build smarter.

Back to Categories
40 questions0 learned

Terraform

State, modules, workflows, drift, remote state, and infrastructure design.

Results: 40
Middle

What is the Terraform state file and why is it important?

Terraform state tracks real infrastructure resources and maps them to your code.

Middle

Why should Terraform state be stored remotely?

Remote state improves collaboration, security, and locking.

Middle

What are Terraform modules?

Modules are reusable groups of Terraform resources.

Junior

What is the difference between terraform plan and terraform apply?

plan previews changes, while apply executes them.

Middle

What does tainting a resource mean in Terraform?

It marks a resource for forced recreation during the next apply.

Middle

What are Terraform workspaces?

Workspaces allow multiple state instances for the same Terraform configuration.

Middle

What is the lifecycle block in Terraform?

The lifecycle block controls how Terraform creates, updates, or destroys resources.

Middle

What is infrastructure drift?

Drift happens when real infrastructure differs from Terraform state or configuration.

Middle

What is terraform import?

It allows bringing existing infrastructure into Terraform state.

Middle

How does Terraform handle dependencies?

Terraform builds a dependency graph based on resource references.

Junior

What is Terraform?

Terraform is an Infrastructure as Code tool used to provision and manage infrastructure.

Junior

What is a provider in Terraform?

A provider is a plugin that lets Terraform interact with an external platform or service.

Junior

What is a resource in Terraform?

A resource is a block that defines an infrastructure object Terraform will manage.

Junior

What is a variable in Terraform?

A variable makes Terraform configurations reusable and configurable.

Junior

What is an output in Terraform?

An output exposes values from Terraform after apply.

Junior

What is main.tf?

main.tf is commonly used as the primary Terraform configuration file.

Junior

What is a .tfvars file?

A .tfvars file provides values for input variables.

Middle

Why is state locking important in Terraform?

State locking prevents multiple users from modifying the same state at the same time.

Middle

What is a backend in Terraform?

A backend defines where Terraform stores its state.

Middle

What is the difference between local state and remote state?

Local state is stored on the local machine, while remote state is stored in shared remote storage.

Junior

What is a module in Terraform?

A module is a reusable collection of Terraform resources.

Middle

What is the difference between a root module and a child module?

The root module is the main working directory, while child modules are called by it.

Junior

What does declarative mean in Terraform?

Declarative means you describe the desired end state, not each step to get there.

Middle

What does idempotent mean in Terraform?

It means repeated applies should result in the same infrastructure state if nothing changed.

Middle

What does Terraform refresh do conceptually?

It updates state to match the real infrastructure.

Junior

What does terraform init do?

terraform init initializes the working directory and downloads required providers and modules.

Junior

What does terraform validate do?

terraform validate checks whether the configuration is syntactically valid.

Junior

What does terraform fmt do?

terraform fmt formats Terraform files consistently.

Middle

What does terraform show do?

terraform show displays human-readable information about state or plan files.

Middle

What does terraform graph do?

terraform graph visualizes resource dependencies.

Junior

What is a typical Terraform workflow?

A typical workflow is init, validate, plan, and apply.

Middle

What is the difference between count and for_each in Terraform?

count uses numeric indexes, while for_each uses keys for more stable resource management.

Middle

What are locals in Terraform?

Locals are named expressions used to simplify and reuse values inside Terraform code.

Middle

What is a data source in Terraform?

A data source reads information from existing infrastructure without creating it.

Middle

When should depends_on be used in Terraform?

depends_on should be used when Terraform cannot infer a dependency automatically.

Middle

What does sensitive mean in Terraform outputs or variables?

Sensitive values are hidden from normal CLI output to reduce exposure.

Middle

Why would Terraform recreate a resource instead of updating it?

Some resource attributes cannot be updated in place and require replacement.

Middle

What does terraform apply -target do and why should it be used carefully?

It applies changes only to selected resources, but it can bypass the normal full dependency workflow.

Senior

What are Terraform best practices for production environments?

Use remote state, locking, modules, code review, validation, and separate environments safely.

Senior

Why do some teams use Terragrunt with Terraform?

Terragrunt helps manage repetition, environment structure, and remote state configuration around Terraform.