You have a list of numbers that represents the number of free CPU cores on each virtual cluster:
numcpus = [ 18, 3, 7, 11, 2 ]
What Terraform function could you use to select the largest number from the list?
You have a list of numbers that represents the number of free CPU cores on each virtual cluster:
numcpus = [ 18, 3, 7, 11, 2 ]
What Terraform function could you use to select the largest number from the list?
To select the largest number from a list in Terraform, you use the max function. The max function takes one or more numbers and returns the greatest number from the set. For the list of CPU cores, max(numcpus) will return the highest value, which is the desired outcome. Other options such as ceil, top, or high are not valid functions for this purpose in Terraform.
"max takes one or more numbers and returns the greatest number from the set."
A is correct See https://developer.hashicorp.com/terraform/language/functions/max