TERRAFORM-ASSOCIATE-003 practice question 13 of 30
[Understand Terraform Basics and CLI] What is one disadvantage of using dynamic blocks in Terraform?
Full set: 226 questionsWhile dynamic blocks are a powerful feature for creating multiple nested configuration blocks from a collection, their primary disadvantage is the potential to reduce the readability and maintainability of the code. They introduce a layer of abstraction; instead of seeing the configuration declared explicitly, a user must interpret the foreach loop and the content block to understand the final resulting infrastructure. The official Terraform documentation explicitly warns that overusing dynamic blocks can make configuration harder to read and maintain.
A. Constructing repeatable nested blocks is the main advantage and intended purpose of dynamic blocks, not a disadvantage.
B. There is no evidence in official documentation that using dynamic blocks inherently causes a significant slowdown in Terraform's execution.
C. This is factually incorrect. Dynamic blocks are specifically designed to iterate over collections like lists and maps using the foreach meta-argument.
1. HashiCorp. (n.d.). Dynamic Blocks. Terraform Documentation. Retrieved from https://developer.hashicorp.com/terraform/language/expressions/dynamic-blocks.
Reference Point: The documentation includes a specific note stating: "We recommend using dynamic blocks only when you need to dynamically generate arguments for a nested block. Overuse of dynamic blocks can make configuration hard to read and maintain." This directly supports option D as the correct answer. The page also demonstrates how dynamic blocks iterate over collections
which refutes option C and confirms the functionality described in option A.
Keep practicing
Take the free TERRAFORM-ASSOCIATE-003 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other TERRAFORM-ASSOCIATE-003 practice questions
- Question 1[Understand Terraform Basics and CLI] If you update the version constraint in your Terraf…
- Question 2[Navigate Terraform State and Backends] Terraform variable names are saved in the state f…
- Question 3[Understand Terraform Basics and CLI] You modified your Terraform configuration and run T…
- Question 4[Understand Terraform Basics and CLI] You must use different Terraform commands depending…
- Question 6[Understand Terraform Basics and CLI] terraform init creates an example main.tf file in t…
- Question 7[Understand Terraform Basics and CLI] terraform validate confirms that your infrastructur…
