0
0
Terraformcloud~5 mins

Import state verification in Terraform - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does 'terraform import' do?
It brings existing infrastructure resources into Terraform's management by adding them to the state file without changing the actual resource.
Click to reveal answer
beginner
Why is verifying the imported state important?
To ensure Terraform's state matches the real resource settings, preventing accidental changes or deletions during future applies.
Click to reveal answer
intermediate
How can you verify the imported resource state?
By running 'terraform plan' after import to see if Terraform wants to make any changes, indicating differences between state and real resource.
Click to reveal answer
intermediate
What should you do if 'terraform plan' shows changes after import?
Review the differences carefully. Update your Terraform configuration to match the real resource or adjust the resource to match the configuration before applying.
Click to reveal answer
beginner
Can 'terraform import' create new resources?
No, it only adds existing resources to the state. It does not create or modify resources during import.
Click to reveal answer
What command do you use to bring an existing resource into Terraform's state?
Aterraform plan
Bterraform apply
Cterraform init
Dterraform import
After importing a resource, which command helps verify if Terraform's state matches the real resource?
Aterraform plan
Bterraform destroy
Cterraform validate
Dterraform refresh
If 'terraform plan' shows changes after import, what should you do?
AIgnore and run 'terraform apply' immediately
BDelete the resource manually
CUpdate configuration or resource to match each other
DRun 'terraform import' again
Does 'terraform import' modify the actual resource during import?
ANo, it only updates the state
BNo, it deletes the resource
CYes, it deletes and recreates the resource
DYes, it updates the resource
What is the main risk if you skip verifying the imported state?
ATerraform might create duplicate resources
BTerraform might delete or change resources unexpectedly
CTerraform will fail to run
DTerraform will ignore the resource
Explain the process and importance of verifying Terraform state after importing a resource.
Think about how Terraform tracks resources and why state accuracy matters.
You got /4 concepts.
    Describe what happens if you run 'terraform import' but do not verify the state before applying changes.
    Consider the consequences of unmanaged differences.
    You got /4 concepts.