PureDevOps Community

Terraform how to get output from module

In terraform how to get the output from module.

If your module has output like this

output "vpc_id" {
  value = aws_vpc.vpc.id
}

then from the parent the output can be accessed like below

output "vpc_id" {
  value = module.vpc.vpc_id
}