Terraform outputs capture the key values you need to access and manage the deployed MEAN stack infrastructure. They are printed to the terminal at the end of every successfulDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mcamacho97/terraform-mean-stack-aws/llms.txt
Use this file to discover all available pages before exploring further.
terraform apply run and can be retrieved at any time thereafter without re-running a plan or apply. Outputs are sourced from module return values — each group of resources (network, compute, load balancer, keypair) exposes its identifiers upward to the root module, which re-exports them as the named outputs documented here.
Accessing Outputs
Network
The ID of the provisioned VPC. Use this value when creating additional resources outside of Terraform that need to be attached to the same network, or when troubleshooting VPC-level routing in the AWS Console.Example value:
vpc-0abc123def456789aNode 1
Public IPv4 address of Node.js Server 1. This instance sits in Public Subnet A (
availability_zone_1) and is registered as a target behind the Application Load Balancer. Use this address for direct SSH access when you need to inspect logs, run deployment scripts, or use Node 1 as a jump host into the private subnet.Example value: 54.210.100.1Private IPv4 address of Node.js Server 1 within the VPC. Used for inter-service communication — for example, when configuring the MongoDB connection string on the Node 1 host to reach the database in the private subnet.Example value:
10.0.1.50Node 2
Public IPv4 address of Node.js Server 2. This instance sits in Public Subnet B (
availability_zone_2), providing cross-AZ redundancy alongside Node 1. Use this address for direct SSH access to the second application server.Example value: 54.210.100.2Private IPv4 address of Node.js Server 2 within the VPC. Referenced when diagnosing traffic distribution between the two Node instances or configuring intra-VPC communication.Example value:
10.0.2.50MongoDB
Private IPv4 address of the MongoDB instance. The MongoDB server is deployed exclusively in the private subnet — it has no public IP address and no inbound internet access. To connect, use one of the Node.js instances as a jump host (see the SSH examples below) or use AWS Systems Manager Session Manager if configured.Example value:
10.0.3.100Load Balancer
DNS hostname of the Application Load Balancer. This is the primary entry point for all HTTP traffic to your application — share this address with users or point a custom domain’s CNAME record at it. The ALB distributes requests across both Node.js instances and performs health checks to route away from unhealthy targets.Example value:
terraform-mean-alb-1234567890.us-east-1.elb.amazonaws.comNAT Gateway
The Elastic IP address associated with the NAT Gateway. All outbound internet traffic from the private subnet (including MongoDB’s OS updates and package downloads) exits through this IP. If you need to allowlist outbound traffic from your private subnet in a third-party firewall or service, this is the IP to use.Example value:
34.205.200.10SSH Key
Filesystem path to the auto-generated PEM private key file. The key pair is created by the
keypair module using the Terraform TLS provider and written to the local keys/ directory at apply time. Pass this path to ssh -i to authenticate to both Node instances.Example value: keys/terraform-mean.pemPractical Usage Examples
State and Output Recovery
Outputs are stored in Terraform state (
terraform.tfstate or in your S3 backend) — they are not written to any external file. If you lose access to state, you can attempt to recover output values by running terraform refresh while the underlying infrastructure still exists. Terraform will re-read the live resource attributes from AWS and repopulate the state file.