title: Terraform - override a single value in a map
body: <p>I would like to know if it is possible to merge two map of maps without replacing the main map object.</p>
  <p>My map object is defined as follows:</p>
  <pre><code>variable &quot;apps&quot; {
  type = map(object({
   is_enabled    = bool
   cost_center   = string
  }))
  default = {}
  }
  
  locals {
    default_apps = {
      &quot;api-1&quot; = {
         is_enabled   = false
         cost_center  = &quot;1234&quot;
      },
      &quot;api-2&quot; = {
         is_enabled   = false
         cost_center  = &quot;1235&quot;
      },
    }
    apps = merge(
      local.default_apps,
      var.apps
    )
  }
  </code></pre>
  <p>If define my tfars as follows, to override the value of api-1['s_enabled']</p>
  <pre><code>  apps = {
      &quot;api-1&quot; = {
        is_enabled   = true
      }
    }
  </code></pre>
  <p>I get the following error:</p>
  <pre><code>Error: Invalid value for input variable
  
  The environment variable TF_VAR_apps does not contain a valid value for
  variable &quot;apps&quot;: element &quot;api-1&quot;: attribute &quot;cost_center&quot; is required.
  </code></pre>
  <p>It works if I define my tfvars like so:</p>
  <pre><code>  apps = {
      &quot;api-1&quot; = {
        is_enabled   = true
        cost_center  = &quot;1234&quot;
      }
    }
  </code></pre>
  <p>My goal is to override a single value of one of the pre defined local variables under <code>default_apps</code> (e.x is_enabled) in tfvars.</p>
  <p>Edit: requirements</p>