HashiCorp Certified: Terraform Associate — Question 35
Why would you use the terraform taint command?
Answer options
- A. When you want to force Terraform to destroy a resource on the next apply
- B. When you want to force Terraform to destroy and recreate a resource on the next apply
- C. When you want Terraform to ignore a resource on the next apply
- D. When you want Terraform to destroy all the infrastructure in your workspace
Correct answer: B
Explanation
The correct answer is B because the terraform taint command marks a resource for recreation during the next apply, ensuring that it is destroyed and then recreated. Option A is incorrect as it only mentions destruction without recreation. Option C is wrong since it describes ignoring a resource rather than recreating it. Option D misrepresents the command's function by suggesting it would destroy all infrastructure, which is not the case.