Template over map

Hello!

Terraform 0.12 introduced new string templates:

<<EOT
%{ for ip in aws_instance.example.*.private_ip }
server ${ip}
%{ endfor }
EOT

I’d like to ask can it iterate over a map? Like:

<<EOT
%{ for ip, name in var.my_cool_map }
${name} ${ip}
%{ endfor }
EOT

If no, how can I achieve that?
Like in 0.11, create an additional template and use count?
Thanks!

Hi @okgolove!

What you tried there looks like it should work to me. Did you encounter an error or unexpected behavior when you tried it?

Hi. Sorry for the late answer.
It seems it works properly but that wasn’t clear for me because of it’s missing in the documentation. It would be great if you added an example with maps to the doc.
Thank you!