HashiCorp Certified: Terraform Associate — Question 55
You run a local-exec provisioner in a null resource called null_resource.run_script and realize that you need to rerun the script.
Which of the following commands would you use first?
Answer options
- A. terraform taint null_resource.run_script
- B. terraform apply -target=null_resource.run_script
- C. terraform validate null_resource.run_script
- D. terraform plan -target=null_resource.run_script
Correct answer: A
Explanation
The correct answer is A, as using 'terraform taint' marks the resource for recreation, triggering the local-exec provisioner to rerun the script. The other options do not initiate a rerun of the provisioner; option B applies changes but does not guarantee a rerun, option C validates configuration without affecting resources, and option D generates an execution plan but does not change the state.