Which outcome is expected when a creation-time provisioner fails?

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 outcome is expected when a creation-time provisioner fails?

Explanation:
Creation-time provisioners run right after a resource is created to configure it further. If that configuration step fails, Terraform marks the resource as tainted. Tainting tells Terraform that this resource is in an unhealthy state and should be replaced, so on the next apply it will be destroyed and recreated to achieve the desired final state. So the expected outcome is that the resource becomes tainted, leading to recreation on a future apply. This isn’t about nothing happening or the plan being aborted by default, and the resource isn’t destroyed immediately during the same apply due to the failed provisioner.

Creation-time provisioners run right after a resource is created to configure it further. If that configuration step fails, Terraform marks the resource as tainted. Tainting tells Terraform that this resource is in an unhealthy state and should be replaced, so on the next apply it will be destroyed and recreated to achieve the desired final state. So the expected outcome is that the resource becomes tainted, leading to recreation on a future apply. This isn’t about nothing happening or the plan being aborted by default, and the resource isn’t destroyed immediately during the same apply due to the failed provisioner.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy