HashiCorp
TERRAFORM-ASSOCIATE-004 · Question #178
You have a list of numbers that represents the number of free CPU cores on each virtual cluster: What Terraform function could you use to select the largest number from the list?
The correct answer is B. max(numcpus). In Terraform, the max function can be used to select the largest number from a list of numbers. The max function takes multiple arguments and returns the highest one. For the list numcpus = [18, 3, 7, 11, 2], using max(numcpus...) will return 18, which is the largest number in th
Submitted by chiamaka_o· Apr 18, 2026Work with Terraform Configurations
Question
You have a list of numbers that represents the number of free CPU cores on each virtual cluster: What Terraform function could you use to select the largest number from the list?
Options
- Atop(numcpus)
- Bmax(numcpus)
- Cceil (numcpus)
- Dhight[numcpus]
How the community answered
(15 responses)- A7% (1)
- B93% (14)
Explanation
In Terraform, the max function can be used to select the largest number from a list of numbers. The max function takes multiple arguments and returns the highest one. For the list numcpus = [18, 3, 7, 11, 2], using max(numcpus...) will return 18, which is the largest number in the list.
Topics
#Terraform functions#max function#numeric functions#list manipulation
Community Discussion
No community discussion yet for this question.