nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #34

Which command add existing resources into Terraform state?

The correct answer is D. Terraform import. 'terraform import' is the command used to bring existing, manually created infrastructure resources under Terraform management by adding them to the Terraform state file. It maps a real-world resource to a resource block in your configuration. 'terraform init' initializes the wor

Submitted by tom_us· Apr 18, 2026Use Terraform CLI

Question

Which command add existing resources into Terraform state?

Options

  • ATerraform init
  • BTerraform plan
  • CTerraform refresh
  • DTerraform import
  • EAll of these

How the community answered

(18 responses)
  • B
    6% (1)
  • C
    6% (1)
  • D
    89% (16)

Explanation

'terraform import' is the command used to bring existing, manually created infrastructure resources under Terraform management by adding them to the Terraform state file. It maps a real-world resource to a resource block in your configuration. 'terraform init' initializes the working directory. 'terraform plan' previews changes. 'terraform refresh' updates the state to match the real-world infrastructure but does not import new resources into state. Only 'terraform import' adds a previously unmanaged resource into Terraform state.

Topics

#Terraform CLI#terraform import#Importing resources#Terraform state management

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice