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
Question
Options
- ATerraform init
- BTerraform plan
- CTerraform refresh
- DTerraform import
- EAll of these
How the community answered
(18 responses)- B6% (1)
- C6% (1)
- D89% (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
Community Discussion
No community discussion yet for this question.