You can use terraform min() function which takes one or more numbers and returns the smallest number from the set.
Open terraform console
1 2 |
## Open terraform console terraform console |
Get the number with min value in terraform
1 2 |
min(30,10,20) ## returns 10 min(30.5,10,-20.7) ## returns -20.7 |
Get the min value from a list of numbers in terraform
1 |
min([30,10,20]...) ## returns 10 |