nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #197

Which command(s) adds existing resources in a public cloud into Terraform state?

The correct answer is D. terraform import. terraform import is the command that brings existing real-world infrastructure under Terraform management by adding it to the state file without destroying and recreating it. terraform init initializes a working directory and downloads providers/modules. terraform plan…

Submitted by jakub_pl· Apr 18, 2026Manage Terraform State

Question

Which command(s) adds existing resources in a public cloud into Terraform state?

Options

  • Aterraform init
  • Bterraform plan
  • Cterraform refresh
  • Dterraform import
  • EAll of these

How the community answered

(42 responses)
  • A
    10% (4)
  • C
    2% (1)
  • D
    86% (36)
  • E
    2% (1)

Explanation

terraform import is the command that brings existing real-world infrastructure under Terraform management by adding it to the state file without destroying and recreating it. terraform init initializes a working directory and downloads providers/modules. terraform plan generates an execution plan by comparing config to state - it does not modify state. terraform refresh updates the state file to reflect the real-world infrastructure but only for resources already tracked in state; it cannot import previously untracked resources.

Topics

#terraform import#state management#existing resources#CLI commands

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice