AfterDocumentation 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 completes, Terraform prints all output values to your terminal and stores them in the remote state file. These outputs surface the connection details and identifiers you need to access your application, SSH into servers, and integrate the deployment with other tooling. You can retrieve any output value at any time without re-running apply.
Accessing Outputs
Print all outputs to the terminal:Output Reference
Network
The AWS-assigned ID of the provisioned VPC (e.g.
vpc-0abc123def456789). Use this value when referencing the VPC in other Terraform workspaces or in the AWS console.Node 1
Public IPv4 address of Node.js Server 1, located in Public Subnet A. Used for direct SSH access.
Private IPv4 address of Node.js Server 1 within the VPC (e.g.
10.0.1.x). Used for internal service-to-service communication.Node 2
Public IPv4 address of Node.js Server 2, located in Public Subnet B. Used for direct SSH access.
Private IPv4 address of Node.js Server 2 within the VPC (e.g.
10.0.2.x). Used for internal service-to-service communication.MongoDB
Private IPv4 address of the MongoDB instance (e.g.
10.0.3.x). MongoDB is deployed in the private subnet and has no public IP address — it is not directly reachable from the internet.Load Balancer
DNS hostname of the Application Load Balancer (e.g.
terraform-mean-alb-1234567890.us-east-1.elb.amazonaws.com). This is the primary entry point for all HTTP traffic to your application. Share this address rather than the individual EC2 IPs.NAT Gateway
Elastic IP address associated with the NAT Gateway. Outbound internet traffic from the MongoDB instance in the private subnet exits AWS through this IP. Useful for whitelisting in third-party services or firewalls.
SSH Key
Local filesystem path to the generated RSA private key file (e.g.
keys/terraform-mean.pem). This file is created by the local provider during apply. Guard it carefully — it grants SSH access to all EC2 instances in the deployment.Using the Outputs
Access the Application
Hit the root endpoint through the load balancer to confirm the application is serving traffic:SSH into Node 1
SSH into Node 2
Connect to MongoDB via SSH Tunnel
MongoDB has no public IP, so connect through one of the Node.js servers as a jump host. The following command opens a local tunnel on port27017 that forwards to the MongoDB private IP:
MongoDB has no public IP address and cannot be reached directly from the internet. All database access must route through one of the Node.js EC2 instances (via SSH tunnel as shown above) or through AWS Systems Manager Session Manager if the SSM agent is configured on the MongoDB instance.