title: terraform modules Error: Reference to undeclared module
body: <p>Please help me with terraform on GCP, i already some days banging my head against the wall. Who have good exp with terraform, you take this 5 mins.   </p>
  
  <p>all needed  files is uploaded,  it is include 2 modules, first (create google project) is static - which downloaded from terraform tegistry it uses when terraform init run ,  and second (create vm in new created google project) - which already  created.  Error file is also uploaded. PLEASE GIVE ADVICE!</p>
  
  <p>1 module is  called project - is worked well, it is create new project and generate in ourput project_id</p>
  
  <p>it use this module -  <a href="https://registry.terraform.io/modules/terraform-google-modules/project-factory/google/5.0.0" rel="nofollow noreferrer">https://registry.terraform.io/modules/terraform-google-modules/project-factory/google/5.0.0</a> </p>
  
  <p>2 module is called redis_vm-  have to use this project_id  (output from module 1) and create new mv and some other thinks, like network and firewall rules. </p>
  
  <p>And main - why from module 2 input - it is not see output from module 1 ?  I try everything.  But always get something like that </p>
  
  <p><strong>Error: Reference to undeclared module
  on modules/redis_vm/main.tf line 13, in resource "google_compute_network" "vpc_network":
    13:   project = "${module.project.project_id}"
  No module call named "project" is declared in redis_vm.</strong></p>
  
  <p>for example if I use in module 2 </p>
  
  <pre><code>resource "google_compute_instance" "default" {
    name         = "${var.name}"
    machine_type = "${var.machine_type}"
    project     =  "${module.project.project_id}"  # - IT IS NOW LOOKING FOR THIS - IT IS OUTPUT FROM MODULE 1
  </code></pre>
  
  <p>link to files here
  <a href="https://drive.google.com/drive/folders/1_s9yuKQ3Prn-9CLsRcovjxes--FW2lcZ?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/drive/folders/1_s9yuKQ3Prn-9CLsRcovjxes--FW2lcZ?usp=sharing</a></p>
  
  <p>Thanks for helping.‹ collapse</p>