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…
Question
Options
- Aterraform init
- Bterraform plan
- Cterraform refresh
- Dterraform import
- EAll of these
How the community answered
(42 responses)- A10% (4)
- C2% (1)
- D86% (36)
- E2% (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
Community Discussion
No community discussion yet for this question.