Recall & Review
beginner
What is the main purpose of provisioners in Terraform?
Provisioners run scripts or commands on resources after they are created to perform setup tasks that Terraform itself cannot do directly.
Click to reveal answer
beginner
When do provisioners run in the Terraform lifecycle?
Provisioners run after the resource is created but before Terraform marks the resource as successfully created.
Click to reveal answer
beginner
Why might you use a provisioner to run a script on a virtual machine resource?
To install software, configure settings, or start services that Terraform cannot manage directly through its resource definitions.
Click to reveal answer
intermediate
What is a common risk when using provisioners in Terraform?
If the script run by a provisioner fails, the entire resource creation can fail, causing deployment issues.
Click to reveal answer
intermediate
How do provisioners help bridge gaps in Terraform's resource management?
They allow running custom scripts or commands on resources to handle tasks Terraform resources don’t support natively.
Click to reveal answer
When do Terraform provisioners run their scripts?
✗ Incorrect
Provisioners run scripts after the resource is created to configure or set up the resource.
What is a typical use case for a Terraform provisioner?
✗ Incorrect
Provisioners are used to run scripts like software installation on resources after creation.
What happens if a provisioner script fails during resource creation?
✗ Incorrect
A failing provisioner causes the resource creation to fail, stopping deployment.
Why might you avoid using provisioners when possible?
✗ Incorrect
Provisioners add risk because script failures can stop resource creation.
Which of these is NOT a reason to use a provisioner?
✗ Incorrect
Provisioners do not manage resource lifecycle natively; they run scripts after creation.
Explain why Terraform provisioners run scripts on resources and when this happens in the resource lifecycle.
Think about what Terraform can’t do by itself and when the resource is ready.
You got /3 concepts.
Describe the risks and best practices when using provisioners in Terraform.
Focus on what can go wrong and how to avoid problems.
You got /4 concepts.