TERRAFORM-ASSOCIATE-004 · Question #209
You created infrastructure outside the Terraform workflow that you now want to manage using Terraform. Which command brings the infrastructure into Terraform state?
The correct answer is C. terraform import. The terraform import command allows Terraform to take existing infrastructure and bring it under Terraform's management. A (terraform get) is incorrect because it is used to fetch modules. B (terraform refresh) is incorrect because it only updates Terraform's state to match the…
Question
Options
- Aterraform get
- Bterraform refresh
- Cterraform import
- Dterraform init
How the community answered
(42 responses)- A2% (1)
- B5% (2)
- C86% (36)
- D7% (3)
Explanation
The terraform import command allows Terraform to take existing infrastructure and bring it under Terraform's management. A (terraform get) is incorrect because it is used to fetch modules. B (terraform refresh) is incorrect because it only updates Terraform's state to match the infrastructure but does not import resources. D (terraform init) is incorrect because it only initializes the Terraform working directory.
Topics
Community Discussion
No community discussion yet for this question.