I want the terraform validate command to flag the following case as a invalid. However, when I run terraform validate, it returns a “valid” result.
Is there any mention of this behavior in the Terraform documentation? I couldn’t find anything when I searched, so if it exists, please let me know.
In my case, I’m using the Output of a nested module, so I was having trouble determining whether this was the cause or if it was due to the way validate handles objects.
terraform version: 1.16.4
# module: database
output "tables" {
value = {
table1 = module.databaseA.table1 # string
table2 = module.databaseA.table2 # string
}
}
------
module "my_module" {
use_table = module.database.tables.table3 # invalid
}