-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need way to interpolate count index as other than zero-based (for host names) #686
Comments
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 |
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 |
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. |
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.
The text was updated successfully, but these errors were encountered: