Is your feature request related to a problem? Please describe.
We currently have many terraform modules with nested objects. E.g., for defining the network of an azure subscription, we have a terraform module with a variable like this:
variable "virtual_networks" {
type = map(object({
cidr_address = string
subnets = map(object({
cidr_address = string
}))
}))
}
This currently can't be mapped to bundle inputs, because it fails with the error terramate schema error: unrecognized "define" child block: [...] unexpected block type "attribute" in attribute "subnets", expected "prompt"
Describe the solution you'd like
Please allow nesting attribute-blocks within attribute-blocks to support nested type definitions.
input "virtual_networks" {
type = map(object)
attribute "cidr_address" {
type = string
}
attribute "subnets" {
type = map(object)
attribute "cidr_address" {
type = string
}
}
}
Describe alternatives you've considered
- We thought about using separate bundles for each virtual network, however this would also create separate stacks for each virtual network, which we do not want in that case. We also have cases where we couldn't flatten the inputs enough, even with separate bundles.
- We could use
type = any, but then we lose the type system features (ability to generate a schema, terramate ui-integration, ...).
Additional context
Terramate version: v0.17.0-rc2
Is your feature request related to a problem? Please describe.
We currently have many terraform modules with nested objects. E.g., for defining the network of an azure subscription, we have a terraform module with a variable like this:
This currently can't be mapped to bundle inputs, because it fails with the error
terramate schema error: unrecognized "define" child block: [...] unexpected block type "attribute" in attribute "subnets", expected "prompt"Describe the solution you'd like
Please allow nesting
attribute-blocks withinattribute-blocks to support nested type definitions.Describe alternatives you've considered
type = any, but then we lose the type system features (ability to generate a schema, terramate ui-integration, ...).Additional context
Terramate version: v0.17.0-rc2