null_resource named examplelocal-exec provisioner that runs the command exit 1 (which will fail)on_failure argument to the provisioner and set it to continuenull_resource named examplelocal-exec provisioner that runs the command exit 1 (which will fail)on_failure argument to the provisioner and set it to continuenull_resource named example.The resource block starts with resource "null_resource" "example" { and ends with }.
null_resource named example, add a provisioner block of type local-exec that runs the command exit 1.The provisioner block should have command = "exit 1" inside.
local-exec provisioner block, add the argument on_failure and set it to continue.The on_failure argument controls what happens if the provisioner fails.
null_resource named example with a local-exec provisioner running exit 1 and on_failure = "continue" set.Review the full resource block to confirm all parts are present.
What does the on_failure argument in a Terraform provisioner control?
on_failureon_failure argument controls what Terraform does if the provisioner fails.on_failure controls failure behavior [OK]Which of the following is the correct syntax to make a provisioner continue even if it fails?
provisioner "local-exec" {
command = "echo Hello"
on_failure = ?
}on_failure valuesfail and continue as valid on_failure values.continue.on_failure = "continue" continues on failure [OK]Given this Terraform snippet, what happens if the local-exec provisioner command fails?
resource "null_resource" "example" {
provisioner "local-exec" {
command = "exit 1"
on_failure = "fail"
}
}on_failure is set to "fail".on_failure = "fail"on_failure = "fail" stops on failure [OK]Identify the error in this provisioner block that causes Terraform to ignore failures unexpectedly:
provisioner "remote-exec" {
inline = ["false_command"]
on_failure = fail
}on_failure syntaxon_failure must be a quoted string, e.g., "fail" or "continue".on_failure value should be a string with quotes. -> Option Bon_failure values require quotes [OK]on_failure values "fail" or "continue" [OK]on_failure valueson_failure is unsupportedYou want to run a local-exec provisioner that might fail but should not stop Terraform from creating other resources. Which configuration achieves this?
resource "null_resource" "example" {
provisioner "local-exec" {
command = "some_command"
on_failure = ?
}
}on_failure valueon_failure = "continue" tells Terraform to ignore provisioner failure and proceed.on_failure = "continue" allows continuation on failure [OK]on_failure valuePass the test and this pattern moves unknown