Reputation: 51
Using the count function within Terraform to create multiple instances of the same type. Each instance is tagged with the correct Name and associated count number. The problem is, when sorting these instances, the first 10 have a single digit. I would like these to have double digits. E.G. 1 would be 01, 2 would 02 etc. The question is, how can I format the numbering of the first ten digits with double digits? Below is a sample of how I'm currently naming the resources.
"Name" = "${var.Event} Candidate ${count.index + 1} Linux Management Interface"
Upvotes: 1
Views: 2109
Reputation: 31
also
ip = "172.16.0.0${count.index}"
te result will be 01 02 03 04 05
Upvotes: 0