title: Iterate a list inside an object with Terraform
body: <p>I'm trying to iterate a list of objects, which each one has a list of String inside, but I'm having trouble with it.</p>
  <p>I tried to use dynamic blocks, but I'm getting the error <strong>Unsupported block type</strong>.</p>
  <p>I'm declaring my variable that way:</p>
  <pre><code>variable &quot;test&quot; {
    type = list(object({
      name = string
      nicknames = list(string)
    }))
  
    default = [
      {
        name = &quot;Phoebe&quot;
        nicknames = [&quot;Pheebs&quot;, &quot;Phalange&quot;]
      },
      {
        name = &quot;Chandler&quot;
        nicknames = [&quot;Chanchan&quot;, &quot;Mr. Bing&quot;]
      }
    ]
  }
  </code></pre>
  <p>And my resource is that way:</p>
  <pre><code>resource &quot;aws_lambda_function&quot; &quot;test_lambda&quot; {
    for_each = {for i, v in var.teste:  i =&gt; v}
    name             = each.value.name
    nicknames  = each.value.nicknames
    dynamic &quot;nicknames_list&quot; {
      for_each = [each.value.nicknames]
      content {
        opn = nicknames_list.value
      }
    }
  }
  </code></pre>
  <p>How can I iterate an object with a list inside?</p>