Around our shop, server names with numbers are done one-based.
Since the only way, in a counted resource, to interpolate a ${count.index} is zero-based, this causes annoying zero-based server names.
IWBNI there were either another "part" for count, say index1, or a way to specify an offset such as indexplus 1 or a way to nest those references and an "add" interpolation. Something, anything, please.
Hm, I think we probably need to introduce basic math into our interpolation language or something...
It would be very helpful if terraform supported basic math feature or index1 feature.
@tkak It is coming )
Done. We added math support in for int types so you can do things like ${count.index+1} now.
I think there might be a related issue for this, but what about left padding a number to a certain number of digits so you can use the count to create server names like server-01, server-02, etc.?
@jimmycuadra There is a sprintf-style issue on page 1 somewhere. :)
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
I think there might be a related issue for this, but what about left padding a number to a certain number of digits so you can use the count to create server names like server-01, server-02, etc.?