Terraform State Management

Configure and manage Terraform state including backends, locking, and drift detection.

5 minutes 5 Questions

Terraform state management is a critical concept for the Terraform Associate certification. The state file (terraform.tfstate) serves as Terraform's source of truth, mapping real-world infrastructure resources to your configuration. It tracks metadata, resource dependencies, and current infrastruct…

Test mode:
TA-004 - Terraform State Management Example Questions

Test your knowledge of Terraform State Management

Question 1

You are a cloud infrastructure engineer at a media streaming company that uses Terraform with an S3 backend and DynamoDB for state locking. Your team operates across multiple CI/CD pipelines that occasionally trigger overlapping Terraform runs. A colleague proposes implementing a custom wrapper script that checks for lock existence before running Terraform commands, arguing this would reduce failed pipeline runs. Another colleague suggests relying solely on Terraform's built-in retry mechanism with the -lock-timeout flag. A third option discussed is implementing a queue-based system that serializes all Terraform operations before they reach the execution phase. The team asks you to evaluate which approach best aligns with Terraform's locking architecture while minimizing operational complexity.

Question 2

What type of infrastructure modification does terraform refresh detect?

Question 3

What does the tilde (~) symbol indicate in terraform plan output when drift is detected?

More Terraform State Management questions
402 questions (total)