Skip to main content

Documentation 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 AWS MEAN Stack is an Infrastructure-as-Code project that provisions a production-ready, multi-tier web application environment on AWS. It orchestrates six reusable Terraform modules to stand up a complete networking layer, load balancing, two Node.js application servers, and a private MongoDB database — fully automated from a single terraform apply.

Introduction

Understand the project goals, architecture, and technology stack before you deploy.

Quickstart

Clone the repo, configure your variables, and have infrastructure running in minutes.

Architecture Overview

Explore the multi-tier AWS architecture and how every component fits together.

Module Reference

Deep-dive into each of the six Terraform modules and their input/output interface.

What Gets Deployed

A single terraform apply provisions the following AWS resources:

Networking

1 VPC, 2 public subnets, 1 private subnet, Internet Gateway, NAT Gateway, and route tables.

Compute

3 EC2 instances — 2 Node.js/Nginx app servers in public subnets and 1 MongoDB server in the private subnet.

Load Balancing

An Application Load Balancer distributing HTTP traffic across both Node.js instances with health checks.

Security

3 layered security groups controlling ALB, Node, and MongoDB access, plus IMDSv2 enforcement.

IAM

An EC2 IAM role with the AmazonSSMManagedInstanceCore policy for session manager access without bastion hosts.

Remote State

S3-backed Terraform remote state for safe, team-friendly infrastructure lifecycle management.

Get Started

1

Install prerequisites

Install Terraform >= 1.12 and the AWS CLI, then configure your AWS credentials.
2

Create your S3 backend bucket

Create an S3 bucket in your target region to store Terraform remote state, then create a backend.hcl file with its details.
3

Configure variables

Copy terraform.tfvars.example to terraform.tfvars and fill in your project name, region, CIDR blocks, and allowed SSH IP.
4

Deploy

Run terraform init -backend-config=backend.hcl, then terraform apply to provision the full stack. Check the Quickstart for the complete walkthrough.
After deployment, Terraform outputs the ALB DNS name, public IPs for both Node.js servers, the MongoDB private IP, and the path to your generated SSH key. See Outputs for details.

Build docs developers (and LLMs) love