title: Terragrunt for_each value, can't retrieve data in other resources
body: <p>I have an issue with my terragrunt/terraform code as below.
  I don't know the right way to retrieve my both crawlers created by my <code>for_each</code> loop.</p>
  <p>Normally I create it with for and <code>count</code>.
  I can't retrieve the correct values in my action triggers (main.tf).</p>
  <p>terragrunt file (input):</p>
  <pre><code>inputs = {
    glue_crawler = {
        crawler    = {
          crawler_name     = &quot;test&quot;,
          description      = &quot;test crawler&quot;
          },
        crawler1   = {
          crawler_name     = &quot;test2&quot;,
          description      = &quot;test2 crawler&quot;
          }
      }
  }
  </code></pre>
  <p>main.tf</p>
  <pre><code>#crawler declaration
  resource &quot;aws_glue_crawler&quot; &quot;default&quot; {
    for_each = var.glue_crawler
  
    database_name = aws_glue_catalog_database.database.name
    name          = &quot;Crawler_${each.value.crawler_name}&quot;
    description   = each.value.description
    role          = aws_iam_role.svc-glue-crawler.id
    table_prefix  = &quot;raw_&quot;
    tags          = var.tags
  
    s3_target {
      path = &quot;${var.s3_glue_name}/${each.value.crawler_name}&quot;
    }
  
   configuration = jsonencode(var.crawler_configuration)
  }
  
  ...
  
  #trigger
  resource &quot;aws_glue_trigger&quot; &quot;my_trigger&quot; {
    name         = var.trigger_name
    schedule     = &quot;cron(00 01 * * ? *)&quot;
    type         = &quot;SCHEDULED&quot;
    enabled      = &quot;false&quot;
    tags         = var.tags
  
    actions {
      job_name   = aws_glue_crawler.default[0].name
    }
  
    actions {
      job_name   = aws_glue_crawler.default[1].name
    }
  
  </code></pre>
  <p>variable.tf</p>
  <pre><code>variable &quot;glue_crawler&quot; {
    type = map(object({
      crawler_name = string
      description   = string
    }))
    default     = {}
    description = &quot;glue crawler definitions.&quot;
  }
  </code></pre>
  <p>When i run this code i have the following errors:</p>
  <pre><code>Error: Invalid index
  
    on main.tf line 294, in resource &quot;aws_glue_trigger&quot; &quot;my_trigger&quot;:  294:     job_name   = aws_glue_crawler.default[0].name
      |----------------
      | aws_glue_crawler.default is object with 2 attributes
  
  The given key does not identify an element in this collection value.
  
  
  Error: Invalid index
  
    on main.tf line 298, in resource &quot;aws_glue_trigger&quot; &quot;my_trigger&quot;:  298:     job_name   = aws_glue_crawler.default[1].name
      |----------------
      | aws_glue_crawler.default is object with 2 attributes
  
  The given key does not identify an element in this collection value.
  </code></pre>