Parse map with nested maps

Hi

I would like to create aws_ssm parameters using the map as data source

  environmental_variables = {
    android_tools = {
      android_home                = "/usr/local/android-sdk"
      android_sdk_version         = "sdk-tools-linux-4333796"
      android_build_tools_version = "30.0.2"
    },
    java = {
      java_home    = "/usr/lib/jvm/java-11-amazon-corretto"
      java_options = "-Xmx2g"
    }
  }

How can I parse these maps to be able to create SSM parameters in one resource block?
Because now I’m only able to do it with 2 resource blocks

resource "aws_ssm_parameter" "parameters" {
  for_each = localenvironmental_variables.android_tools

  name  = "/workers/${each.key}"
  type  = "String"
  value = each.value
}