title: How to call parent resource output in child module in terraform
body: <p>I am creating a below</p>
  <p>ABC
  -- ecs.tf     (gives me cluster id)</p>
  <p>Content of ecs.tf:</p>
  <pre><code>resource &quot;aws_ecs_cluster&quot; &quot;first_cluster&quot; {
    name = &quot;firstCluster&quot;
    capacity_providers = [&quot;FARGATE&quot;]
    default_capacity_provider_strategy {
      capacity_provider = &quot;FARGATE&quot;
      base              = 0
      weight            = 1
    }
    setting {
      name  = &quot;containerInsights&quot;
      value = &quot;enabled&quot;
    }
  }
  output &quot;cluster_id&quot; {
    value = aws_ecs_cluster.first_cluster.id
  }
  </code></pre>
  <p>Now under ABC folder which is root folder, i have another folder with CHILD folder which has app.tf</p>
  <p><a href="https://i.stack.imgur.com/igYFC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/igYFC.png" alt="ABC/
  ├─ CHILD/
  │  ├─ app.tf
  ├─ ecs.tf" /></a></p>
  <p><strong>Question:</strong>
  How can i use cluster_id from ecs.tf in CHILD\app.tf ?</p>
  <p>app.tf:</p>
  <ul>
  <li>module in this file is already calling different module and one of the input is cluster_id.</li>
  </ul>
  <p>This is the challenge, i need to get the cluster_id value from ecs.tf output value from parent folder</p>
  <p>My app.tf file contains something like below</p>
  <pre><code>module &quot;xyz&quot; {
  source = &quot;some modudle which needs cluster_id as input&quot;
  cluster_id = ??
  }
  </code></pre>
  <p>Help me with what i need to put for cluster_id</p>