TERRAFORM-ASSOCIATE-004 · Question #68
What is a key benefit of the Terraform state file?
The correct answer is B. A state file is a source of truth for resources provisioned with Terraform. The Terraform state file (terraform.tfstate) acts as the source of truth for all resources that Terraform manages. It maps real-world infrastructure to your configuration, tracks metadata, and allows Terraform to determine what changes need to be made on subsequent applies…
Question
Options
- AA state file can schedule recurring infrastructure tasks
- BA state file is a source of truth for resources provisioned with Terraform
- CA state file is a source of truth for resources provisioned with a public cloud console
- DA state file is the desired state expressed by the Terraform code files
How the community answered
(27 responses)- B96% (26)
- D4% (1)
Explanation
The Terraform state file (terraform.tfstate) acts as the source of truth for all resources that Terraform manages. It maps real-world infrastructure to your configuration, tracks metadata, and allows Terraform to determine what changes need to be made on subsequent applies. Option A is incorrect because state files don't schedule tasks. Option C is wrong because the state file only tracks resources provisioned by Terraform, not resources created via a cloud console (unless imported). Option D confuses state with configuration - the .tf code files represent desired state, while the state file represents actual current state.
Topics
Community Discussion
No community discussion yet for this question.