nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · 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…

Read, generate, and modify configuration

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

(50 responses)
  • A
    4% (2)
  • B
    70% (35)
  • C
    18% (9)
  • D
    8% (4)

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

#built-in functions#max function#numeric functions#collection functions

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice