Terraform provisioners can be added to any resource block. True or False?

Prepare for your Terraform Associate Exam with our engaging quiz. Test your knowledge with multiple choice questions and receive detailed explanations to enhance your understanding. Ace your exam with confidence!

Provisioners in Terraform are a way to execute scripts or commands on resources to help with the final configuration after the resource has been created. However, it is not accurate to say that provisioners can be added to any resource block.

In practice, provisioners are typically used with certain resource types where the post-creation configuration is meaningful, such as virtual machines, cloud instances, or containers. However, there are some resource types where it does not make sense to use provisioners because they do not involve a running instance or do not require additional configuration that can be managed by scripts.

Additionally, using provisioners is often discouraged because they can introduce complexity and unpredictability into infrastructure code. Instead, there are better practices such as managing post-provisioning configurations through configuration management tools or explicitly defining stateful configurations separately from Terraform’s resource management.

Therefore, the statement is false as provisioners can only be defined on specific resource types where their use is appropriate and meaningful.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy