Require help with for_each scenario

Hello All, I am new to terraform and require community help.
Getting below error:

 Error: Unsupported attribute
│ 
│   on certificate/main.tf line 48, in resource "vault_pki_secret_backend_config_ca" "intermediate":
│   48:   pem_bundle =  "${data.vault_generic_secret.cert_key[each.key][each.value.key]}\n${data.vault_generic_secret.cert_key[each.key][each.value.int_cert]}\n${data.vault_generic_secret.cert_key[each.key][each.value.root_cert]}"
│     ├────────────────
│     │ each.value is object with 4 attributes
│ 
│ This object does not have an attribute named "root_cert".

CODE

**CERTIFICATE MODULE CODE**
data "vault_generic_secret" "cert_key" {
 for_each      = var.enable_pki_intermediate_path
 provider      = vault.vault-prd
 path          = each.value["vault_path"]
}

variable "enable_pki_intermediate_path" {
 type = map(object({
   path                          = string
   vault_path                    = string
   default_lease_ttl_seconds     = number
   max_lease_ttl_seconds         = number
 }))
}

resource "vault_pki_secret_backend_config_ca" "intermediate" {
 for_each              = var.enable_pki_intermediate_path
 backend               = each.value["path"]
 depends_on            = [vault_mount.pki_int]
 pem_bundle =  "${data.vault_generic_secret.cert_key[each.key][each.value.key]}\n${data.vault_generic_secret.cert_key[each.key][each.value.int_cert]}\n${data.vault_generic_secret.cert_key[each.key][each.value.root_cert]}"
}

**MODULE CODE**
module "pki_cert_xxx" {
 source                    = "./certificate"

 enable_pki_intermediate_path = {
 "san" = {
   path                      = "pki_xxx_xxx_xxx"
   vault_path                = "secret/dev/devops/vaultpki/xxx/abc"
   default_lease_ttl_seconds = 1261440000
   max_lease_ttl_seconds     = 1261440000
   }
 "sas" = {
   path                      = "pki_xxx_xxx_xxx"
   vault_path                = "secret/dev/devops/vaultpki/xxx/efg"
   default_lease_ttl_seconds = 1261440000
   max_lease_ttl_seconds     = 1261440000
   }
}

How data is stored in the vault

The formatting of your code is all messed up by the forum software. Please enclose code sections in ``` so we can read it as intended.

I have made the required changes to the format

The formatting of the error message is still messed up and would benefit from ``` markers too.

Still, with the code itself readable, it can be seen that the problem is in your expressions like

In this context, each.value is one of the values from your Terraform variable, such as:

and this of course does not have an entry key to reference.