Which of the following Terraform type definitions correctly defines a tuple with a string, a number, and a boolean in that order?
Remember that tuple types require the exact order of types as elements.
Tuple types in Terraform require the exact sequence of types. Option D correctly lists string, number, then bool.
Given this Terraform variable declaration, which option correctly assigns a valid value to it?
variable "example" {
type = tuple([string, number, bool])
}Match the order of types: string, number, bool.
The tuple type requires the first element to be a string, second a number, and third a boolean. Only option A matches this order.
You want to pass a tuple of a string and a number to a Terraform module input. Which type definition and input value pair is correct?
Check both the type order and the value order.
The tuple type and value must match in order and type. Option C correctly defines and assigns a tuple of string then number.
Which statement about using tuple types for sensitive data in Terraform is true?
Consider how Terraform handles sensitivity at the type level.
Terraform currently does not support marking individual tuple elements as sensitive. Sensitivity applies to the entire variable or output.
In Terraform 1.5+, you define a tuple type with an optional third element: tuple([string, number, optional(bool)]). What happens if you assign the value ["test", 10] to this variable?
Think about how optional elements in tuple types work in Terraform 1.5 and later.
Terraform 1.5+ supports optional tuple elements. Omitting the optional bool element is valid and does not cause errors.