Single output variable to return all resource values where a for_each was used

Hi folks

I have a need to create a output variable that returns all the nested values from the replication instance resource I’m creating that uses a map of objects variable in a for_each loop (to create multiple dms replcation instances). I used to do this at my last place so know it’s possible but so far have only gotten it working with a single attribute(see my outputs.tf snip). My googling searches have been fruitless so far. Can anyone give me a syntax example of this please? So to clarify I’m wanting to create a “replication_instance_outputs” output variable that returns all the attributes for each replication instance created e.g. replication_instance_class, engine_version etc

snip of variables .tf

# Replication Instances
variable "replication_instances" {
  description = "Map of objects that define the replication instances to be created"
  type        = any
  default     = {}
}

snip of main.tf

resource "aws_dms_replication_instance" "this" {
  for_each = { for k, v in var.replication_instances : k => v if var.create }

  replication_instance_id      = each.key
  replication_instance_class   = lookup(each.value, "repl_instance_class", null)
  allocated_storage            = lookup(each.value, "repl_instance_allocated_storage", 50)
  auto_minor_version_upgrade   = lookup(each.value, "repl_instance_auto_minor_version_upgrade", null)
  allow_major_version_upgrade  = lookup(each.value, "repl_instance_allow_major_version_upgrade", null)
  apply_immediately            = lookup(each.value, "repl_instance_apply_immediately", null)
  availability_zone            = lookup(each.value, "repl_availability_zone", null)
  engine_version               = lookup(each.value, "repl_instance_engine_version", null)
  kms_key_arn                  = lookup(each.value, "repl_kms_key_arn", null)
  multi_az                     = lookup(each.value, "repl_instance_multi_az", false)
  preferred_maintenance_window = lookup(each.value, "repl_instance_preferred_maintenance_window", null)
  publicly_accessible          = lookup(each.value, "repl_instance_publicly_accessible", false)
  replication_subnet_group_id  = lookup(each.value, "replication_subnet_group_id", null)
  vpc_security_group_ids       = lookup(each.value, "repl_instance_vpc_security_group_ids", null)

  tags = merge(var.tags, var.repl_instance_tags)

  timeouts {
    create = lookup(var.repl_instance_timeouts, "create", null)
    update = lookup(var.repl_instance_timeouts, "update", null)
    delete = lookup(var.repl_instance_timeouts, "delete", null)
  }

  depends_on = [time_sleep.wait_for_dependency_resources]
}

snip of outputs.tf

# Instance
output "replication_instance_arn" {
  description = "The Amazon Resource Name (ARN) of the replication instances"
  value = values(aws_dms_replication_instance.this)[*].replication_instance_arn
}

OK so I think it was just this. I think my confusion came from the fact that before I used to explicitly state the nested attribtes during the variable declaration. If I had done this am I right in thinking the below would need to change somehow to allow people to reference a specific nested attribute being returned rather than all of them?

output "replication_instances" {
  description = "A map of objects containing the replication instances and their full output of attributes and values"
  value       = aws_dms_replication_instance.this
}