nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #155

Define the purpose of state in Terraform.

The correct answer is A. State maps real world resources to your configuration and keeps track of metadata. The purpose of state in Terraform is to keep track of the real-world resources managed by Terraform, mapping them to the configuration. The state file contains metadata about these resources, such as resource IDs and other important attributes, which Terraform uses to plan and ma

Submitted by luis.pe· Apr 18, 2026Manage Terraform State

Question

Define the purpose of state in Terraform.

Options

  • AState maps real world resources to your configuration and keeps track of metadata
  • BState lets you enforce resource configurations that relate to compliance policies
  • CState stores variables and lets you quickly reuse existing code
  • DState codifies the dependencies of related resources

How the community answered

(27 responses)
  • A
    93% (25)
  • B
    4% (1)
  • C
    4% (1)

Explanation

The purpose of state in Terraform is to keep track of the real-world resources managed by Terraform, mapping them to the configuration. The state file contains metadata about these resources, such as resource IDs and other important attributes, which Terraform uses to plan and manage infrastructure changes. The state enables Terraform to know what resources are managed by which configurations and helps in maintaining the desired state of the infrastructure.

Topics

#Terraform State#Resource Mapping#State File#Metadata Management

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice