So I’ve spent the last couple of days banging my head against this, and I’m hoping that someone can point me in the right direction. I’ve got an AWS VPC terraform module that works totally fine and I can use a parent module to call it and input the variables and all that jazz.
What I’m trying to do is take the output of specific modules (ex. aws_vpc.*.id amongst others) and reference/call them from another child module in the same directory.
Folder Structure:
-dev
|-- main.tf <- this works great with the VPC module
-modules
|–VPC
|— stuff-with-outputs.tf <- want to reference resource ID’s from this module
|–EC2
|—stuff-that-I-am-calling-from.tf <- wanting to reuse said resources so I keep my code dry.
Any assistance would be greatly appreciated!