If a resource is tainted, what will Terraform do on the next apply?

Prepare for the HashiCorp Terraform Associate Exam. Utilize flashcards and multiple-choice questions with detailed hints and explanations. Boost your confidence and be ready for success!

Multiple Choice

If a resource is tainted, what will Terraform do on the next apply?

Explanation:
When a resource is tainted, Terraform treats it as needing replacement rather than an in-place update. On the next apply, Terraform will replace the resource: it will destroy the existing instance and then create a new one to match the current configuration. In the plan, this appears as a replace action (often shown as Destroy followed by Create). So the correct idea is that tainted resources are recreated on the next apply. This isn’t about doing nothing, nor simply destroying without recreating, and tainting is the manual step that marks the resource for replacement, not the apply action itself.

When a resource is tainted, Terraform treats it as needing replacement rather than an in-place update. On the next apply, Terraform will replace the resource: it will destroy the existing instance and then create a new one to match the current configuration. In the plan, this appears as a replace action (often shown as Destroy followed by Create).

So the correct idea is that tainted resources are recreated on the next apply. This isn’t about doing nothing, nor simply destroying without recreating, and tainting is the manual step that marks the resource for replacement, not the apply action itself.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy