In Terraform HCL, what does the object type of object({ name=string, age=number }) match?

Prepare for your Terraform Associate Exam with our engaging quiz. Test your knowledge with multiple choice questions and receive detailed explanations to enhance your understanding. Ace your exam with confidence!

The correct answer demonstrates the object type object({ name = string, age = number }), which indicates that the object must have two specific attributes: name must be a string and age must be a number.

In this context, both "name" and "age" adhere to the specified types, meaning that "name" can be any string value, and "age" must be a numeric value that does not enclose digits in quotes.

The first choice satisfies the object definition since "name" is a string and "age" is a number. The second choice also meets the type requirements, with "name" being a valid string and "age" as a proper number, making it a correct match.

The third choice is excluded because even though "name" is a valid string, "age" is provided as a string representation of a number, which does not match the required number type.

Similarly, the fourth choice is invalid because while "name" is a string, setting "age" to null does not satisfy the number type requirement; null is not considered a number in this instance.

Hence, the option that meets all criteria outlined in the object type definition is the one

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy