nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #171

You want to define multiple data disks as nested blocks inside the resource block for a virtual machine. What Terraform feature would help you define the blocks using the values in a variable?

The correct answer is D. Dynamic blocks. Dynamic blocks in Terraform allow you to define multiple nested blocks within a resource based on the values of a variable. This feature is particularly useful for scenarios where the number of nested blocks is not fixed and can change based on variable input.

Read, generate, and modify configuration

Question

You want to define multiple data disks as nested blocks inside the resource block for a virtual machine. What Terraform feature would help you define the blocks using the values in a variable?

Options

  • ALocal values
  • BCount arguments
  • CCollection functions
  • DDynamic blocks

How the community answered

(27 responses)
  • A
    4% (1)
  • B
    11% (3)
  • C
    15% (4)
  • D
    70% (19)

Explanation

Dynamic blocks in Terraform allow you to define multiple nested blocks within a resource based on the values of a variable. This feature is particularly useful for scenarios where the number of nested blocks is not fixed and can change based on variable input.

Topics

#dynamic blocks#nested blocks#meta-arguments#configuration iteration

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice