Challenge - 5 Problems
Terraform Numeric Functions Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate1:00remaining
Terraform min function output
What is the output of the following Terraform expression?
min(5, 3, 9, 1)Terraform
min(5, 3, 9, 1)
Attempts:
2 left
💡 Hint
The min function returns the smallest number from the list.
✗ Incorrect
The min function compares all the numbers and returns the smallest one, which is 1.
❓ service_behavior
intermediate1:00remaining
Terraform max function output
What value does this Terraform expression return?
max(2.5, 7.1, 4.8, 6.0)Terraform
max(2.5, 7.1, 4.8, 6.0)
Attempts:
2 left
💡 Hint
The max function returns the largest number from the list.
✗ Incorrect
The max function returns the highest value among the inputs, which is 7.1.
❓ Configuration
advanced1:30remaining
Using ceil function in Terraform
Given this Terraform expression:
What is the output?
ceil(4.3)What is the output?
Terraform
ceil(4.3)Attempts:
2 left
💡 Hint
The ceil function rounds a number up to the nearest whole number.
✗ Incorrect
The ceil function rounds 4.3 up to 5.
❓ Architecture
advanced1:30remaining
Combining min, max, and ceil in Terraform
What is the output of this Terraform expression?
ceil(min(3.2, 5.7, 4.1) + max(1.5, 2.8))Terraform
ceil(min(3.2, 5.7, 4.1) + max(1.5, 2.8))
Attempts:
2 left
💡 Hint
Calculate min and max first, then add and apply ceil.
✗ Incorrect
min(3.2,5.7,4.1) = 3.2, max(1.5,2.8) = 2.8, sum = 6.0, ceil(6.0) = 6.
❓ security
expert2:00remaining
Terraform numeric function misuse impact
If a Terraform configuration uses
ceil on a negative float value like ceil(-3.7), what is the output and potential impact on resource scaling?Terraform
ceil(-3.7)Attempts:
2 left
💡 Hint
Remember how ceil rounds negative numbers.
✗ Incorrect
ceil(-3.7) rounds up to -3 but since -3 is greater than -3.7, ceil actually returns -3. Terraform's ceil function rounds towards positive infinity, so ceil(-3.7) returns -3. This can cause resource counts to be higher than expected if negative values are used incorrectly.