nerdexam
HashiCorp

TA-002-P · Question #115

Terraform must track metadata such as resource dependencies. Where is this data stored?

The correct answer is C. state file. Terraform stores all metadata - including resource dependencies, resource IDs, attribute values, and the mapping between your configuration and real-world infrastructure - in the state file (terraform.tfstate). This file is the source of truth for what Terraform has deployed…

Implement and maintain state

Question

Terraform must track metadata such as resource dependencies. Where is this data stored?

Options

  • Aworkspace
  • Bbackend
  • Cstate file
  • Dmetadata store

How the community answered

(38 responses)
  • B
    3% (1)
  • C
    92% (35)
  • D
    5% (2)

Explanation

Terraform stores all metadata - including resource dependencies, resource IDs, attribute values, and the mapping between your configuration and real-world infrastructure - in the state file (terraform.tfstate). This file is the source of truth for what Terraform has deployed. Without the state file, Terraform cannot determine what exists or in what order resources must be created/destroyed. Options A (workspace) and B (backend) are related concepts but are not where the metadata itself lives; they determine where the state file is stored. A 'metadata store' (D) is not a Terraform concept.

Topics

#Terraform state#State file#Resource dependencies#Metadata tracking

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice