How to reference a data source from a module to another module and pass it as a variable to root module?

I have terraform directory structure as below: terraform/ main.tf modules outputs.tf provider.tf variables.tf ./modules: compute network resourcegroup ./modules/compute: main.tf outputs.tf variables.tf ./modules/network: main.tf outputs.tf variables.tf ./modules/resourcegroup: main.tf outputs.tf variables.tf resourcegroup module config files as below: Purpose: In this module, I am referencing an existing resource group which I would like to utilized to create a…