Applying the software development principle of DRY (Don't Repeat Yourself) is considered a best practice when using Terraform. For example, multiple instances of the same resource can be created using the for_each or count meta-arguments.
Some resource types include repeatable nested blocks representing separate resources or attributes that are embedded within the resource. These nested blocks can be defined using the dynamic block type, which can further improve the maintainability of your Terraform template.
In this lab, you will refactor a Terraform template to use dynamic blocks. You will also learn how dynamic blocks differ from Terraform meta-arguments.
Upon completion of this intermediate-level lab, you will be able to:
Familiarity with the following will be beneficial but is not required:
The following content can be used to fulfill the prerequisites: