Terraform how-to: create a variable list of numbered items
In a couple of templates I worked on I came across the need to create a variable list of numbered strings that is a product of a different list.
Dealing with this kind of thing is easy when you’re dealing with resources (that support count
). It’s less straight-forward when you need to create a local
variable, say, to use for a resource’s value, or an output
, that don’t.
Let’s have a look at a dirty hack that can help. 🙂