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?✗ Incorrect
terraform taint marks a resource to be replaced on the next terraform apply.
Which command removes the tainted state from a resource?
✗ Incorrect
terraform untaint clears the tainted state so the resource is not replaced.
Why should you avoid using
terraform taint now?✗ Incorrect
Terraform recommends terraform apply -replace as a clearer way to replace resources.
What is the effect of running
terraform apply -replace=resource_address?✗ Incorrect
This command forces replacement of the specified resource during apply.
If a resource is tainted, what will happen on the next
terraform apply?✗ Incorrect
Tainted resources are destroyed and recreated on apply.
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.