Terraform local block issue

hi I am still new to terraform and i am probably over complicating something that is really simple I wanted to use map variable to include variables and realised it was not supported. the variable is a secret and is passed during pipeline run. this
my understanding was to use local block for the variables but this seems to cause an error

the goal is to be able to deploy multiple azure container apps quickly by just adding to variables for more container but struggling with the handling of the variable that contains the secret when the pipeline is run.

│ Error: Unsupported attribute

│ on main.tf line 38, in resource “azurerm_container_app” “aci_scim_bridge”:
│ 38: value = each.value.scim_secret
│ ├────────────────
│ │ each.value is object with 2 attributes

variable "1_scim_secret"{}

variable "2_scim_secret"{}

variable "container_apps" {
  type = map(object({
    name                = string
    description         = string
    company             = string
  }))
  description = "Map of container applications with their names, descriptions, and scim session secrets."
  default = {
    1 = {
      name                = "op-1-cae"
      description         = "Name of the Container App."
      company             ="company1"
    },
    2 = {
      name                = "op-2-cae"
      description         = "Name of the Container App."
      company             = "company2"
    }
} 
locals {
  container_apps_with_secrets = {
    1 = merge(
      var.container_apps["1"],
      { scim_secret = var.1_scim_secret }
    ),
    2 = merge(
      var.container_apps["2"],
      { scim_secret = var.2_scim_secret }
    )
  }
}

turns out was just making things overly complicated and didn’t need the map variable at all this is what worked for me in the end in case anyone wants to try something similar

variable "1_scim_secret"{}

variable "2_scim_secret"{}

locals {
  container_apps = {
    1 = {
      name        = "op-company1-cae"
      description = "Name of the Container App."
      company     = "1"
      scim_secret = var.1_scim_secret
    },
    2= {
      name        = "op-company2-cae"
      description = "Name of the Container App."
      company     = "cinch"
      scim_secret = var.2_scim_secret
    }
  }


# Create Azure Container Instances for each container app within the same resource group
resource "azurerm_container_app" "aci_scim_bridge" {
  for_each = local.container_apps


  name                = each.value.name
  resource_group_name = var.resource_group_name
  container_app_environment_id = azurerm_container_app_environment.aci_app_env.id
  revision_mode                = "Single"
  
  ingress {
    external_enabled = true
    target_port      = ""
    traffic_weight {
      latest_revision = true
      percentage      = ""
    }
  }
  secret {
      name  = "scimsession"
      value = each.value.scim_secret
    }