Flatten on a map object with nested list strings

I need help from someone to help flatten the code below with local terraform resource.

Thanks

variable vpc_peer {
  default = {
    vpc_peer1 = {
      aws_account_id = "acct-id"
      region  = "region-1"
      vpc_id  = "vpc-id"
      route_table_cidr_block = "10.0.0.0/16"
      route_table_ids = [
         "rtb-1",
         "rtb-2"
      ]
    }
  }
}

Expectation:

With for_each function

 resource "aws_route" "my_route" {
      destination_cidr_block    = "172.0.0.0/24"
      id                        = (known after apply)
      instance_id               = (known after apply)
      instance_owner_id         = (known after apply)
      network_interface_id      = (known after apply)
      origin                    = (known after apply)
      route_table_id            =  ["rtb-1", "rtb-2"]
      state                     = (known after apply)
      vpc_peering_connection_id = (known after apply)
}

i got it solved here https://discuss.hashicorp.com/t/using-flatten-on-a-nested-map-of-differing-value-types/11901/7