Challenge - 5 Problems
Provisioner Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate2:00remaining
What happens when a local-exec provisioner fails during resource creation?
In Terraform, if a
local-exec provisioner attached to a resource fails during the resource creation phase, what is the resulting behavior?Attempts:
2 left
💡 Hint
Think about how Terraform treats provisioner failures during resource creation.
✗ Incorrect
Terraform treats provisioner failures during resource creation as errors, aborting the apply and marking the resource as tainted to indicate it needs recreation.
❓ service_behavior
intermediate2:00remaining
What is the default behavior of Terraform when a remote-exec provisioner fails during resource destruction?
If a
remote-exec provisioner fails during the destruction of a resource, what does Terraform do by default?Attempts:
2 left
💡 Hint
Consider how Terraform treats provisioner failures during destroy phase.
✗ Incorrect
By default, Terraform ignores provisioner failures during resource destruction and continues with the destroy operation.
❓ Architecture
advanced2:00remaining
Which option correctly describes the effect of
on_failure = 'continue' in a provisioner block?In a Terraform provisioner block, setting
on_failure = 'continue' changes the failure behavior. What is the exact effect of this setting?Attempts:
2 left
💡 Hint
Think about how
on_failure controls marking resources as tainted.✗ Incorrect
Setting
on_failure = 'continue' tells Terraform to continue the apply even if the provisioner fails and not mark the resource as tainted.❓ security
advanced2:00remaining
What security risk arises if a provisioner script fails silently due to
on_failure = 'continue'?If a provisioner script that configures security settings fails but
on_failure = 'continue' is set, what is the main security risk?Attempts:
2 left
💡 Hint
Consider what happens if security steps are skipped silently.
✗ Incorrect
If the provisioner fails silently, the resource may lack critical security configurations, exposing it to vulnerabilities.
✅ Best Practice
expert3:00remaining
Which approach best ensures reliable provisioning with Terraform provisioners?
To minimize failures and ensure reliable execution of provisioner scripts in Terraform, which approach is best?
Attempts:
2 left
💡 Hint
Think about Terraform's recommended best practices for provisioning.
✗ Incorrect
Terraform recommends avoiding provisioners when possible and using dedicated configuration management or cloud-init for reliable provisioning.