Is it mandatory to include a provisioner within a resource block when configuring resources in Terraform?

Master the HashiCorp Terraform Test with these flashcards and multiple choice questions. Each question includes hints and explanations to prepare you effectively. Set yourself up for success!

In Terraform, it is not required to include a provisioner within a resource block when configuring resources. Provisioners are used to execute scripts or commands on a resource after it has been created, typically for the purpose of configuration management, software installation, or other setup tasks. However, many resources can be created and managed without needing any additional post-creation steps.

The use of provisioners is optional and only necessary if the specific scenario warrants executing code or further configuration after resource provisioning. This makes them a helpful tool but not a mandatory aspect of all resource configurations in Terraform. Therefore, the statement that it is mandatory to include a provisioner is false, affirming that incorporating provisioners is a matter of need based on the specific use case of the infrastructure being defined.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy