TA-002-P · Question #144
By default, a defined provisioner is a creation-time provisioner.
The correct answer is A. True. By default, Terraform provisioners are executed only once when the resource they are associated with is initially created.
Question
By default, a defined provisioner is a creation-time provisioner.
Options
- ATrue
- BFalse
How the community answered
(34 responses)- A91% (31)
- B9% (3)
Why each option
By default, Terraform provisioners are executed only once when the resource they are associated with is initially created.
Terraform provisioners are 'creation-time' provisioners by default, meaning they run after the resource they are attached to has been successfully created. If you want a provisioner to run during destruction, you must explicitly set its 'when' argument to 'destroy'.
This is incorrect; the default behavior for provisioners is to execute at resource creation time, not at other lifecycle stages without explicit configuration.
Concept tested: Terraform provisioner default execution timing
Source: https://developer.hashicorp.com/terraform/language/resources/provisioners/syntax#creation-time-provisioners
Topics
Community Discussion
No community discussion yet for this question.