Which statement best describes the use of terraform taint?

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

Which statement best describes the use of terraform taint?

Explanation:
Tainting a resource flags it for replacement. Terraform keeps track of each resource in state, and when a resource is tainted, the next plan shows that this resource must be replaced rather than updated in place. On apply, Terraform will destroy the old instance and create a new one to satisfy the taint, effectively performing a replacement of that resource. This is useful when a resource is in a bad or drifted state and needs to be recreated rather than modified in place. The other options don’t fit because tainting doesn’t ignore a resource, destroy all infrastructure, or merely destroy a resource without recreating it. It specifically targets a single resource for destruction and recreation on the next apply.

Tainting a resource flags it for replacement. Terraform keeps track of each resource in state, and when a resource is tainted, the next plan shows that this resource must be replaced rather than updated in place. On apply, Terraform will destroy the old instance and create a new one to satisfy the taint, effectively performing a replacement of that resource. This is useful when a resource is in a bad or drifted state and needs to be recreated rather than modified in place.

The other options don’t fit because tainting doesn’t ignore a resource, destroy all infrastructure, or merely destroy a resource without recreating it. It specifically targets a single resource for destruction and recreation on the next apply.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy