Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions variables/complex_types/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Complex Types

A complex type is a type that groups multiple values into a single value. Complex types are represented by type constructors, but several of them also have shorthand keyword versions.

There are two categories of complex types: collection types (for grouping similar values), and structural types (for grouping potentially dissimilar values).

https://www.terraform.io/docs/language/expressions/type-constraints.html#complex-types
16 changes: 16 additions & 0 deletions variables/complex_types/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
variable "structural-type" {
type = object({
object = object({
string = string
number = number
bool = bool
}),
list = list(any),
map = map(string),
set = set(number)
})
}

output "structural-type" {
value = var.structural-type
}