Practice IaC state management vocabulary: Terraform state files, remote backends, state locking, state drift, and importing existing resources into state.
0 / 5 completed
1 / 5
Terraform tracks managed infrastructure in a ___ file that records the current known state of every resource.
The Terraform state file (terraform.tfstate) is a JSON record that maps each resource in your configuration to its real-world counterpart. Terraform uses it to determine what changes are needed when you run plan or apply.
2 / 5
The team stores state in a ___ backend so all engineers work from the same state.
A remote state backend (S3 + DynamoDB, GCS, Azure Blob Storage, Terraform Cloud) stores the state file in a shared location. This allows multiple engineers to run Terraform against the same infrastructure, and enables state locking to prevent conflicts.
3 / 5
The pipeline fails: 'The state is ___ by another run.' What does this mean?
State locking prevents two Terraform processes from modifying the same state simultaneously, which could corrupt it. DynamoDB (for S3 backend) or the Terraform Cloud backend handle locking. If a run is interrupted, the lock must be manually released.
4 / 5
The monitoring alerts show ___ drift: resources exist in AWS that are not in Terraform state, or state differs from reality.
State drift occurs when the actual cloud resources diverge from what the Terraform state file records. Common causes include manual changes via the console, resource drift from external automation, or resources modified by other tools. terraform plan detects drift.
5 / 5
The ops team needs to manage an existing load balancer. They run terraform ___ to bring it under Terraform's control.
terraform import adds an existing cloud resource to the Terraform state file without recreating it. This lets you start managing manually created resources with Terraform. You still need to write the corresponding configuration to match the imported resource.