You can use terraform sum() to sum the elements of a list. sum() takes a list or set of numbers and returns the sum of those numbers.
Syntax: sum(list)
Example:
1 2 3 4 5 6 |
## Open terraform console terraform console ## Sum the elements of a list sum([10,30,20.1,-4,3]) ## returns 59.1 |