TERRAFORM-ASSOCIATE-004 · Question #19
What is one disadvantage of using dynamic blocks in Terraform?
The correct answer is D. They make configuration harder to read and understand. Dynamic blocks allow you to programmatically generate repeated nested configuration blocks using for_each, which is a powerful feature (not a disadvantage). The key trade-off and primary disadvantage is that they make the configuration significantly harder to read and understand
Question
Options
- ADynamic blocks can construct repeatable nested blocks
- BTerraform will run more slowly
- CThey cannot be used to loop through a list of values
- DThey make configuration harder to read and understand
How the community answered
(59 responses)- A2% (1)
- B3% (2)
- C2% (1)
- D93% (55)
Explanation
Dynamic blocks allow you to programmatically generate repeated nested configuration blocks using for_each, which is a powerful feature (not a disadvantage). The key trade-off and primary disadvantage is that they make the configuration significantly harder to read and understand (D) - a reader must mentally evaluate the dynamic expression to know what nested blocks will actually be generated, rather than reading them explicitly. Option A describes a benefit. Option B is false. Option C is false - dynamic blocks can and do iterate over lists.
Topics
Community Discussion
No community discussion yet for this question.