Hello,
I challenging to implement new functionality by refactoring variables definition without breaking backward compatibility.
Input
Original variable definition
variable "inputs" {
type = map(map(bool))
description = <<EOF
(Optional) redshift-enabled (bool) - Redshift enabler switcher
(Optional) cdp-crawlers-enabled (bool) - Crawler enable switcher
EOF
}
Desired definition:
variable "inputs" {
type = map(map(any))
description = <<EOF
(Optional) redshift-enabled (bool) - Redshift enabler switcher.
(Optional) crawlers-enabled (bool) - Crawler enable switcher.
(Optional) s3_versioning_enabled (bool) - Bucket versioning enable switcher.
(Optional) tags (map(string)) - input specific tags
EOF
}
Issues
- Trying desired definition would lead to
Error: Incorrect variable type. ... : all map elements must have the same type.
This is not the first time but I would expect any to be any(any) and not homogeneous(any).
-
Trying converting into the object looks to enforce the structure schema and breaks compatibility.
-
We are not ready to use terraform 1.3 and try optional attribute .