Dynamic populate map key and value in for_each loop

Hi,

I’m using a for_each loop to create an aws_ssm_patch_baseline. Part of the required inputs is a patch_filters block. The block is a string value for key and value so there isn’t any key name unique. Code is below:

resource “aws_ssm_patch_baseline” “baseline_policy” {
for_each = var.baseline
name = each.value.name
description = each.value.description
operating_system = each.value.operating_system
approval_rule {
approve_after_days = each.value.approval_after_days
}

    patch_filters {
      each.value.classification = each.value.classifications
      each.value.group = each.value.grouping
    }

}

How would i construct the map dynamically within the for_Each for the patch_filters section?