Hello,
I have been looking at various interpolation function in Terraform and were not able to find basic sum function.
What I have is a list of ints: [5, 0, 1, 2] which specify number of nodes I need to create (They are the same type). What I would like to have is just a function that can just sum the list of ints.
Example:
variable "key_list" {
type = list
default = [5, 0, 1, 2]
}
resource "instance" "vm" {
count = "${sum(key_list)}"
}
Would be a really nice function to have.
Hello,
I have been looking at various interpolation function in Terraform and were not able to find basic
sumfunction.What I have is a list of ints: [5, 0, 1, 2] which specify number of nodes I need to create (They are the same type). What I would like to have is just a function that can just sum the list of ints.
Example:
Would be a really nice function to have.