HashiCorp Certified: Terraform Associate — Question 302
If a Terraform creation-time provisioner fails, what will occur by default?
Answer options
- A. The resource will not be affected, but the provisioner will need to be applied again
- B. The resource will be destroyed
- C. The resource will be marked as "tainted"
- D. Nothing, provisioners will not show errors in the command line
Correct answer: C
Explanation
When a provisioner fails during the creation of a resource in Terraform, the resource is marked as 'tainted', indicating that it may need to be recreated. This is important for ensuring that any issues with the provisioner are addressed before reapplying. The other options are incorrect because they either imply no effect on the resource when there is, or suggest that the resource would be destroyed or left unchanged without a taint.