I'm working on infrastructure provisioning, so I'm calling modules as nested.
There is my file system tree.
├── main.tf
└── modules
├── client.tf
└── in
└── main.tf
My files showing as below .
#main.tf
module "my_vpc" {
source = "./modules"
}
# modules/client.tf
provider "aws" {
region = "us-east-2"
}
module "inner" {
source = "./in"
}
# in/main.tf
provider "aws" {
region = "us-east-2"
}
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
}
output "vpc_id" {
value = "${aws_vpc.main.id}"
}
So in my case, I want to get the outputs coming from resource-created modules at in/main.tf. But when I ran the terraform apply command there is no output.
How I can solve this problem?