Map Object with Optional Attributes

I am attempting to write a module to build subnets from a map variable looking something like this…

   subnets = {
     "subnet1" = {
       "address_prefix" = ""
     "subnet2" = {
       "address_prefix" = ""
       "service_endpoints" = [

Used like so in the call to the module…

module "subnets" {
  source               = "../../.."
  resource_group_name  =
  virtual_network_name =
  subnets              = local.settings.virtual_network.subnets

Because map attributes must be of the same type, I’m attempting to use a variable like this in the module.

variable "subnets" {
  description = "A map of subnets"
  type = map(object({
    address_prefix    = string
    service_endpoints = list(string)

However, this way requires that every subnet has service_endpoints, which is not always the case. Is there a way to make that optional? The resource I’m using in the module uses for_each…

resource "azurerm_subnet" "subnet" {
  for_each = var.subnets

  name                 = each.key
  resource_group_name  = var.resource_group_name
  virtual_network_name = var.virtual_network_name
  address_prefix       = each.value["address_prefix"]
  service_endpoints    = each.value["service_endpoints"]

I haven’t found a way to do optional atributes, either.
But, using empty maps and lists produce the expected result with dynamic and for_any

Not possible yet apparently?