I want to use the optional parameter to pass optional parameters:
variable "clients" {
type = map(object({
description = string
initiated_login_uri = optional(string)
allowed_clients = optional(list(string), [])
}))
}
resource "auth0_client" "this" {
for_each = var.clients
description = each.value.description
initiate_login_uri = each.value.initiated_login_uri
allowed_clients = each.value.allowed_clients
}
For which, as I understood I should be able to send
clients = {
client_0 = {
description = "Description"
initiated_login_uri = "http://example.com"
allowed_clients = ["XXXXXX"]
},
client_1 = {
description = "Description"
}
}
But got
all map elements must have the same type
Any way to fix that? Meaning each element of a map with non-mandatory attributes?