The for_each Meta-Argument - Configuration Language | Terraform | HashiCorp Developer
The for_each meta-argument allows you to manage similar infrastructure resources without writing a separate block for each one.