Complete the code to define a variable with a complex type list of strings.
variable "example_list" { type = [1] }
The variable type list(string) defines a list where each item is a string. This is a common complex type in Terraform.
Complete the code to define a variable with a map of numbers.
variable "example_map" { type = [1] }
The type map(number) defines a map where each key maps to a number value.
Fix the error in the variable type definition for a set of strings.
variable "example_set" { type = [1] }
The correct type for a set of strings is set(string). It represents an unordered collection of unique strings.
Fill both blanks to define an object type with two attributes: name (string) and count (number).
variable "example_object" { type = object({ name = [1], count = [2] }) }
The object type requires attribute types. Here, name is a string and count is a number.
Fill all three blanks to define a complex variable: a list of objects with attributes id (number), enabled (bool), and tags (list of strings).
variable "complex_var" { type = list(object({ id = [1], enabled = [2], tags = [3] })) }
The object attributes are: id as number, enabled as bool, and tags as list of strings.