0

I have a nested module moduleNested

github.com/acme/moduleNested

that is a composite of:

github.com/acme/moduleA
github.com/acme/moduleB 
github.com/acme/moduleC

each module specific its own outputs, lets say 1 each respectively as:

AOut1, BOut1, COut1

When I instantiate the nested module,

module "sample_moduleNested" {
  source = "github.com/acme/moduleNested"

the resources are provisioned, but seemingly with no outputs.

How do I expose the aggregated outputs modules for the Nested itself? If I run

terraform output -module="sample_moduleNested"

on the nested module instance I have no outputs? It prints a message:

The module root.sample_moduleNested could not be found. There is nothing to output or am I referencing output wrong?  

Do I need to have an explicit:

outputs.tf 

file in

github.com/acme/moduleNested

Any help / advice appreciated. Cheers!

user2992225
  • 247
  • 4
  • 14
  • 3
    Yes you need to pass outputs up through nested modules as far as you need them, including to the root module if you want to display it on the screen. This is also a duplicate which I'll link to when I find it. – ydaetskcoR Feb 22 '19 at 13:03
  • 4
    Possible duplicate of ['Not a valid output for module' when using output variable with terraform](https://stackoverflow.com/questions/48084463/not-a-valid-output-for-module-when-using-output-variable-with-terraform) – ydaetskcoR Feb 22 '19 at 13:05
  • Thanks! I missed this post let me read it. – user2992225 Feb 22 '19 at 15:17

0 Answers0