Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 180

If a Terraform creation-time provisioner fails, what will occur by default?

    Correct Answer: C

    If a Terraform creation-time provisioner fails, the resource is marked as tainted. This ensures that any resource potentially left in an incomplete or unstable state due to the failure will be destroyed and recreated during the next terraform apply. Tainting a resource helps maintain the desired state by ensuring that partially configured resources are not left in the infrastructure.

Discussion
BurakkoOption: C

If a creation-time provisioner fails, the resource is marked as tainted. A tainted resource will be planned for destruction and recreation upon the next terraform apply .

jednorozec2022

C ref https://www.terraform.io/language/resources/provisioners/syntax#creation-time-provisioners

mamoon_malta2022Option: C

Answer C: If a creation-time provisioner fails, the resource is marked as tainted. A tainted resource will be planned for destruction and recreation upon the next terraform apply. Terraform does this because a failed provisioner can leave a resource in a semi-configured state. Because Terraform cannot reason about what the provisioner does, the only way to ensure proper creation of a resource is to recreate it. This is tainting.

tabkarOption: C

"If a creation-time provisioner fails, the resource is marked as tainted." https://developer.hashicorp.com/terraform/language/resources/provisioners/syntax