Introduction
Sometimes when Terraform creates resources, it runs extra scripts called provisioners. These scripts can fail, and Terraform needs to know what to do next. This concept explains how Terraform handles failures in these provisioners and how you can control that behavior.
When you want to run a setup script on a virtual machine after it is created.
When you need to install software automatically on a new server during deployment.
When you want to copy files to a resource right after it is created.
When you want to control if Terraform should stop or continue when a provisioner script fails.
When you want to debug why a resource creation failed due to a script error.