0
0
Terraformcloud~5 mins

Terraform taint and untaint (deprecated) - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the terraform taint command do?
It marks a specific resource as needing to be destroyed and recreated on the next terraform apply. This forces Terraform to replace the resource.
Click to reveal answer
beginner
What is the purpose of terraform untaint?
It removes the 'tainted' state from a resource, so Terraform will no longer destroy and recreate it on the next apply.
Click to reveal answer
intermediate
Why are terraform taint and untaint considered deprecated?
Because Terraform now recommends using the terraform apply -replace option to replace resources, which is more explicit and easier to manage.
Click to reveal answer
intermediate
How would you replace a resource without using terraform taint?
Use terraform apply -replace=resource_address to mark the resource for replacement during the apply.
Click to reveal answer
beginner
What happens if you run terraform taint on a resource and then run terraform apply?
Terraform will destroy the tainted resource and create a new one to replace it during the apply process.
Click to reveal answer
What does terraform taint do to a resource?
ADeletes it immediately
BPrevents any changes
CMarks it for replacement on next apply
DBacks up the resource state
Which command removes the tainted state from a resource?
Aterraform untaint
Bterraform remove
Cterraform clean
Dterraform reset
Why should you avoid using terraform taint now?
AIt is deprecated in favor of <code>terraform apply -replace</code>
BIt deletes your entire infrastructure
CIt is slower than other commands
DIt requires manual state file editing
What is the effect of running terraform apply -replace=resource_address?
AIt updates the resource in place
BIt replaces the resource during apply
CIt deletes the resource without replacement
DIt ignores the resource
If a resource is tainted, what will happen on the next terraform apply?
ATerraform will fail the apply
BTerraform will skip the resource
CTerraform will update the resource without replacement
DTerraform will recreate the resource
Explain what terraform taint and terraform untaint commands do and why they are deprecated.
Think about how Terraform manages resource replacement now.
You got /4 concepts.
    Describe how you would replace a resource in Terraform without using the deprecated taint command.
    Focus on the modern recommended command.
    You got /3 concepts.