Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 210


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?

Show Answer
Correct Answer: C

To define multiple data disks as nested blocks inside the resource block for a virtual machine using values in a variable, the Terraform feature you need is dynamic blocks. Dynamic blocks allow you to iterate over a list or map and create multiple instances of a nested block within a resource, making it possible to use the values in a variable to generate multiple configurations.

Discussion

3 comments
Sign in to comment
ArizonaClassics
Jul 14, 2024

C is correct

AbuuOption: C
Aug 6, 2024

The correct answer is C. Dynamic Blocks. Dynamic blocks allow you to define multiple data disks as nested blocks inside the resource block for a virtual machine by using the values in a variable. Dynamic blocks are used to create multiple resource instances from a single configuration block by iterating over the values of a list or map.

campsOption: C
Sep 30, 2024

C. Dynamic blocks