Challenge - 5 Problems
Terraform Object Type Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Configuration
intermediate2:00remaining
Identify the correct Terraform object type definition
Which option correctly defines a Terraform object type with a string field
name and a number field count?Attempts:
2 left
💡 Hint
Terraform object types use curly braces with key = type pairs.
✗ Incorrect
Terraform object type syntax requires curly braces with keys and types separated by =. Colons or brackets are invalid.
❓ service_behavior
intermediate2:00remaining
What happens if a Terraform object type is missing a required attribute?
Given a Terraform object type
object({ name = string, count = number }), what error occurs if you provide an object missing the count attribute?Attempts:
2 left
💡 Hint
Terraform enforces required attributes in object types strictly.
✗ Incorrect
Terraform requires all attributes defined in an object type to be present; missing attributes cause validation errors during plan.
❓ Architecture
advanced2:30remaining
Choose the correct nested object type definition in Terraform
Which option correctly defines a Terraform object type with a string
name and a nested object settings containing a boolean enabled and a list of strings tags?Attempts:
2 left
💡 Hint
Nested objects use object() with curly braces inside the parent object definition.
✗ Incorrect
Terraform nested object types require object() with curly braces for the nested attributes. Square brackets or map() are invalid here.
❓ security
advanced2:00remaining
What is the security implication of using
any type instead of a strict object type in Terraform?If you replace a strict object type with
any in Terraform variable definitions, what is the main security risk?Attempts:
2 left
💡 Hint
Using
any disables type checking.✗ Incorrect
Using
any disables strict type checking, which can allow unsafe or unexpected data to be passed, risking misconfiguration or security issues.✅ Best Practice
expert3:00remaining
Which Terraform object type definition best enforces immutability of a configuration block?
You want to define a Terraform object type for a configuration block that should not allow extra attributes beyond
id (string) and enabled (bool). Which option enforces this strictly?Attempts:
2 left
💡 Hint
Terraform object types do not support additional properties by default.
✗ Incorrect
Terraform object types only allow the attributes defined. Options A and C allow extra attributes or are invalid syntax. Option C is not valid Terraform syntax.