Recall & Review
beginner
What is the purpose of writing configuration for imported resources in Terraform?
It allows Terraform to manage existing infrastructure by matching the imported resource with its configuration, so future changes can be tracked and applied.
Click to reveal answer
beginner
After importing a resource, why must you write its configuration in Terraform files?
Because importing only adds the resource to the state file; without configuration, Terraform doesn't know how to manage or update the resource.
Click to reveal answer
beginner
True or False: Terraform import automatically creates the resource configuration file.False. Terraform import only updates the state. You must manually write the resource configuration to match the imported resource.Click to reveal answer
intermediate
What is a best practice when writing configuration for imported resources?
Use the exact resource attributes as they exist in the cloud provider to avoid unexpected changes during future Terraform runs.
Click to reveal answer
beginner
How can you verify that your imported resource configuration matches the actual resource?
Run 'terraform plan' to see if Terraform wants to make any changes. If no changes are planned, the configuration matches the resource.
Click to reveal answer
What does 'terraform import' do?
✗ Incorrect
'terraform import' only adds the existing resource to the Terraform state file. It does not create configuration files.
Why is it important to write configuration after importing a resource?
✗ Incorrect
Without configuration, Terraform cannot manage or update the imported resource.
What command helps you check if your imported resource configuration matches the actual resource?
✗ Incorrect
'terraform plan' shows if Terraform wants to make any changes, indicating if configuration matches the resource.
If 'terraform plan' shows changes after import and configuration, what does it mean?
✗ Incorrect
Changes in plan mean the configuration differs from the actual resource state.
Which is a recommended step after importing a resource?
✗ Incorrect
Writing configuration ensures Terraform can manage the imported resource properly.
Explain the process and importance of writing configuration for imported resources in Terraform.
Think about what import does and what Terraform needs to manage resources.
You got /5 concepts.
Describe how you would verify that your imported resource configuration is correct and what to do if it is not.
Use Terraform commands to compare configuration and actual resource.
You got /5 concepts.