TERRAFORM-ASSOCIATE-004 · Question #59
TERRAFORM-ASSOCIATE-004 Question #59: Real Exam Question with Answer & Explanation
The correct answer is A: Dynamic. The dynamic block is used to construct a collection of repeated nested configuration blocks programmatically. It accepts an iterable (list or map) and generates one nested block per item, avoiding repetitive hardcoded blocks. For example, a dynamic "ingress" block inside an aws_s
Question
What type of block is used to construct a collection of nested configuration blocks?
Options
- ADynamic
- BFor_each
- CNesting
- Drepeated.
Explanation
The dynamic block is used to construct a collection of repeated nested configuration blocks programmatically. It accepts an iterable (list or map) and generates one nested block per item, avoiding repetitive hardcoded blocks. For example, a dynamic "ingress" block inside an aws_security_group resource can generate multiple ingress rules from a variable list. for_each is a meta-argument for iterating over resource or module instances, not for generating nested blocks within a single resource.
Topics
Community Discussion
No community discussion yet for this question.