nerdexam
HashiCorp

TA-002-P · Question #1

The terraform.tfstate file always matches your currently built infrastructure.

The correct answer is B. False. The terraform.tfstate file reflects the infrastructure Terraform believes it has created, but it may not always perfectly match the actual cloud infrastructure due to manual changes or out-of-band modifications.

Implement and maintain state

Question

The terraform.tfstate file always matches your currently built infrastructure.

Options

  • ATrue
  • BFalse

How the community answered

(28 responses)
  • A
    14% (4)
  • B
    86% (24)

Why each option

The terraform.tfstate file reflects the infrastructure Terraform *believes* it has created, but it may not always perfectly match the actual cloud infrastructure due to manual changes or out-of-band modifications.

ATrue

While Terraform strives to keep the state file synchronized, manual modifications to resources in the cloud provider or issues during a Terraform run can lead to discrepancies, meaning it doesn't *always* match.

BFalseCorrect

The state file is a snapshot of the infrastructure according to Terraform's last known configuration and apply, but external changes made directly in the cloud provider can cause the actual infrastructure to drift from the state file without Terraform's knowledge.

Concept tested: Terraform state file accuracy

Source: https://developer.hashicorp.com/terraform/language/state

Topics

#terraform state#state file#infrastructure drift#state management

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice