TERRAFORM-ASSOCIATE-004 · Question #112
How is terraform import run?
The correct answer is D. By an explicit call. 'terraform import' is a standalone command that must be invoked explicitly by the user. It is not triggered or executed automatically as part of 'terraform init', 'terraform plan', or 'terraform refresh'. When you run 'terraform import <resource_address> <resource_id>', Terraform
Question
Options
- AAs a part of terraform init
- BAs a part of terraform plan
- CAs a part of terraform refresh
- DBy an explicit call
- EAll of the above
How the community answered
(35 responses)- A3% (1)
- C6% (2)
- D91% (32)
Explanation
'terraform import' is a standalone command that must be invoked explicitly by the user. It is not triggered or executed automatically as part of 'terraform init', 'terraform plan', or 'terraform refresh'. When you run 'terraform import <resource_address> <resource_id>', Terraform queries the provider for the existing resource and writes its state into the state file. Because it is a deliberate, explicit operation (and requires you to have already written the corresponding resource block in your config), it is always run as a direct call.
Topics
Community Discussion
No community discussion yet for this question.