Process Flow - Numeric functions (min, max, ceil)
Input Numbers
Apply min()
Apply max()
Apply ceil()
Output Results
The flow takes input numbers, applies min, max, and ceil functions step-by-step, then outputs the results.
variable "nums" { default = [1.2, 3.7, 2.5] } output "min_val" { value = min(var.nums...) } output "max_val" { value = max(var.nums...) } output "ceil_vals" { value = [for n in var.nums : ceil(n)] }
| Step | Function | Input | Evaluation | Result |
|---|---|---|---|---|
| 1 | min | [1.2, 3.7, 2.5] | Compare all numbers | 1.2 |
| 2 | max | [1.2, 3.7, 2.5] | Compare all numbers | 3.7 |
| 3 | ceil | 1.2 | Round up to nearest integer | 2 |
| 4 | ceil | 3.7 | Round up to nearest integer | 4 |
| 5 | ceil | 2.5 | Round up to nearest integer | 3 |
| 6 | Output | min_val | Output min value | 1.2 |
| 7 | Output | max_val | Output max value | 3.7 |
| 8 | Output | ceil_vals | Output list of ceil values | [2, 4, 3] |
| Variable | Start | After Step 1 | After Step 2 | After Steps 3-5 | Final |
|---|---|---|---|---|---|
| var.nums | [1.2, 3.7, 2.5] | [1.2, 3.7, 2.5] | [1.2, 3.7, 2.5] | [1.2, 3.7, 2.5] | [1.2, 3.7, 2.5] |
| min_val | undefined | 1.2 | 1.2 | 1.2 | 1.2 |
| max_val | undefined | undefined | 3.7 | 3.7 | 3.7 |
| ceil_vals | undefined | undefined | undefined | [2, 4, 3] | [2, 4, 3] |
Terraform numeric functions: - min(list): returns smallest number - max(list): returns largest number - ceil(number): rounds number up Use min/max on lists, ceil on each number Outputs show results clearly