nerdexam
HashiCorp

TA-002-P · Question #32

A Terraform provisioner must be nested inside a resource configuration block.

The correct answer is A. True. Provisioners in Terraform must always be declared as a nested block inside a resource configuration block. They cannot exist at the top level of a module or independently. This scoping is by design - provisioners execute in the context of the resource they are attached to, either

Understand Terraform basics

Question

A Terraform provisioner must be nested inside a resource configuration block.

Options

  • ATrue
  • BFalse

How the community answered

(38 responses)
  • A
    87% (33)
  • B
    13% (5)

Explanation

Provisioners in Terraform must always be declared as a nested block inside a resource configuration block. They cannot exist at the top level of a module or independently. This scoping is by design - provisioners execute in the context of the resource they are attached to, either during creation or destruction of that specific resource.

Topics

#Terraform syntax#Provisioners#Resource configuration#HCL

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice