HashiCorp Certified: Terraform Associate — Question 172
You created infrastructure outside of the Terraform workflow that you now want to manage using Terraform. Which command brings the infrastructure into Terraform state?
Answer options
- A. terraform init
- B. terraform get
- C. terraform refresh
- D. terraform import
Correct answer: D
Explanation
The 'terraform import' command is specifically designed to bring existing infrastructure into the Terraform state, allowing Terraform to manage it. The other options, such as 'terraform init', are for initializing a Terraform working directory, 'terraform get' retrieves modules, and 'terraform refresh' updates the state with real infrastructure data but does not import it.