Map of objects with list

I have variable with map of objects with consumer_groups as list(string)
variable “eventhub_entityname” {
description = “eventhub”
type = map(object({
entity_partition_count = number
entity_message_retention = number
entity_status = optional(string)
storage_capture_needed = bool
capture_encoding = string
capture_interval_in_seconds = optional(number)
capture_skip_empty_archives = optional(bool)
capture_size_limit_in_bytes = optional(number)
consumer_groups = optional(list(string))
}))
}

eventhub_entityname = {
firstdemo = {
entity_partition_count = 1
entity_message_retention = 1
storage_capture_needed = true
capture_encoding = “Avro”
consumer_group = [“test1”, “test2”]
}
seconddemo ={
entity_partition_count = 1
entity_message_retention = 1
storage_capture_needed = true
capture_encoding = “Avro”
consumer_group = [“test3”]

}
}

now i need to loop first with firstdemo and create test1 and test2 2 consumer groups in it and come back to seconddemo and create test3 consumer group