nerdexam
HashiCorpHashiCorp

TERRAFORM-ASSOCIATE-004 · Question #171

TERRAFORM-ASSOCIATE-004 Question #171: Real Exam Question with Answer & Explanation

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.

Submitted by kevin_r· Apr 18, 2026Work with Terraform Configurations

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

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#Resource Configuration#Variables

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 PracticeBrowse All TERRAFORM-ASSOCIATE-004 Questions