title: Terraform tries to reorder and recreate config block in a loop every time one is added
body: <p>I'm seeing some weird behaviour when I modify config blocks in a loop.</p>
  <p>It looks like Terraform is resorting the config blocks or something:</p>
  <pre><code>// example map
  variable &quot;my_apps&quot; {
    type = map(object({
      app-type-1 = list(string)
    }))
  
    default = {
      us-east-1 = {
        app-type-1 = [
          &quot;app1&quot;,
        ]
      }
      us-west-2 = {
        app-type-1 = [
          &quot;app1&quot;,
          &quot;app2&quot;,
          &quot;app3&quot;
        ]
      }
    }
  }
  
  // loop over map
  resource &quot;aws_elastic_beanstalk_configuration_template&quot; &quot;mytemplate&quot; {
    depends_on = [aws_elastic_beanstalk_application.myapp]
    provider      = aws.us-west-2
    for_each = toset(var.beanstalk_applications[&quot;us-west-2&quot;][&quot;app-type-1&quot;])
    name = &quot;app-type1-base&quot;
    application = each.value
    solution_stack_name = &quot;64bit Amazon Linux 2015.09 v2.0.8 running Go 1.4&quot;
    setting {
      namespace = &quot;aws:ec2:vpc&quot;
      name = &quot;VPCId&quot;
      value = &quot;blah&quot;
    }
    setting {
      namespace = &quot;aws:ec2:vpc&quot;
      name = &quot;Subnets&quot;
      value = &quot;blah&quot;
    }
    // added this
    setting {
      namespace = &quot;aws:ec2:vpc&quot;
      name = &quot;ELBSubnets&quot;
      value = &quot;blah&quot;
    }
  }
  </code></pre>
  <p>When I add a new block terraform reorders the whole thing</p>
  <pre><code>+ setting {
      + name      = &quot;ELBSubnets&quot;
      + namespace = &quot;aws:ec2:vpc&quot;
      + value     = &quot;blah&quot;
    }
  - setting {
      - name      = &quot;Subnets&quot; -&gt; null
      - namespace = &quot;aws:ec2:vpc&quot; -&gt; null
      - value     = &quot;blah&quot; -&gt; null
    }
  + setting {
      + name      = &quot;Subnets&quot;
      + namespace = &quot;aws:ec2:vpc&quot;
      + value     = &quot;blah&quot;
    }
  - setting {
      - name      = &quot;VPCId&quot; -&gt; null
      - namespace = &quot;aws:ec2:vpc&quot; -&gt; null
      - value     = &quot;blah&quot; -&gt; null
    }
  + setting {
      + name      = &quot;VPCId&quot;
      + namespace = &quot;aws:ec2:vpc&quot;
      + value     = &quot;blah&quot;
    }
  </code></pre>