This project demonstrates complete deployment and validation of a 3-tier architecture on AWS. The implementation includes presentation tier (web servers), application tier (app servers), and database tier deployed across multiple Availability Zones, with comprehensive testing and documentation.
- Presentation Tier: NGINX web servers with React frontend
- Application Tier: Node.js application servers
- Database Tier: Amazon RDS Aurora MySQL with Multi-AZ configuration
- Infrastructure: VPC with public/private subnets, Load Balancers, Auto Scaling
- Security: IAM roles, Security Groups, Session Manager access
- Multi-AZ Deployment: Architecture across two Availability Zones
- Auto Scaling Configuration: Dynamic scaling based on CPU utilization
- Load Balancing Setup: External and Internal Application Load Balancers
- Secure Access: AWS Systems Manager Session Manager for instance access
- Monitoring Setup: SNS notifications for scaling events
- Network Monitoring: VPC Flow Logs for traffic analysis
- AWS Account with appropriate permissions
- Application code (React frontend and Node.js backend)
- Basic understanding of AWS services
-
S3 Bucket Creation
- Created the primary S3 bucket
s3bucket025to store the application source code - This bucket serves as the central repository for both frontend and backend code
- Created the primary S3 bucket
-
S3 Bucket List View
- Viewed the S3 dashboard showing the successfully created buckets
- Prepared second bucket for VPC Flow Logs
-
Application Folder Structure Creation
- Created
application-code/folder to logically separate application code - Contains subfolders for each tier of the architecture
- Created
-
Code Upload Confirmation
- Verified successful upload of application code
app-tier/contains Node.js backend sourceweb-tier/contains React.js frontend and Nginx configuration
-
IAM Role Service Selection
- Initiated IAM role creation with AWS service as trusted entity
- EC2 as use case for secure access to S3 and Systems Manager
-
S3 Read-Only Access Policy
- Attached
AmazonS3ReadOnlyAccesspolicy - Follows principle of least privilege for downloading application code
- Attached
-
SSM Managed Instance Core Policy
- Added
AmazonSSMManagedInstanceCorepolicy - Enables AWS Systems Manager Session Manager connectivity
- Added
-
IAM Role Final Configuration
- Configured IAM role with name
abcd-ec2-s3-ssm-role-025-9-14 - Added descriptive metadata and consistent tagging strategy
- Configured IAM role with name
-
IAM Role Creation Success
- Successfully created IAM role for all EC2 instances
- Provides secure access without hardcoded credentials
-
VPC Creation Configuration
- Initiated custom VPC creation with name
MY-VPC - IPv4 CIDR block
10.0.0.0/16providing 65,536 IP addresses
- Initiated custom VPC creation with name
-
VPC Creation Success
- Successfully created custom VPC
- Serves as isolated network foundation for entire architecture
-
Subnet Creation Initialization
- Started subnet creation process within custom VPC
- Preparing for network segmentation and multi-AZ deployment
-
Web Tier Subnet 1 Creation
- Created
WEB-TIER-SUBNET-1in Availability Zoneus-east-2a - CIDR
10.0.1.0/24for public web servers
- Created
-
Application Tier Subnet 1 Creation
- Created
APP-TIER-SUBNET-1in Availability Zoneus-east-2a - CIDR
10.0.2.0/24for private application servers
- Created
-
Database Tier Subnet 1 Creation
- Created
DB-TIER-SUBNET-1in Availability Zoneus-east-2a - CIDR
10.0.3.0/24for database instances
- Created
-
Web Tier Subnet 2 Creation
- Created
WEB-TIER-SUBNET-2in Availability Zoneus-east-2b - CIDR
10.0.4.0/24for high availability web tier
- Created
-
Application Tier Subnet 2 Creation
- Created
APP-TIER-SUBNET-2in Availability Zoneus-east-2b - CIDR
10.0.5.0/24for high availability application servers
- Created
-
Database Tier Subnet 2 Creation
- Created
DB-TIER-SUBNET-2in Availability Zoneus-east-2b - CIDR
10.0.6.0/24completes database tier high availability
- Created
-
All Subnets Creation Success
- Successfully created all six subnets across two Availability Zones
- Complete network foundation for multi-AZ, multi-tier deployment
-
Web Tier Subnet Settings Access
- Accessed subnet settings for
WEB-TIER-SUBNET-1 - Configure auto-assignment of public IPv4 addresses
- Accessed subnet settings for
-
Public IP Auto-Assignment Configuration
- Enabled auto-assign public IPv4 addresses for web tier subnets
- Ensures instances automatically receive public IP addresses
-
Public Subnet Configuration Success
- Successfully configured both web tier subnets with public IP auto-assignment
- Maintained private configuration for application and database tiers
-
VPC Flow Logs S3 Bucket Creation
- Created dedicated S3 bucket
myvpcflowlogsbucket025for VPC Flow Logs - Separation ensures operational logs don't interfere with application assets
- Created dedicated S3 bucket
-
Dual S3 Bucket Configuration
- Verified both S3 buckets successfully created
mys3bucket025for application codemyvpcflowlogsbucket025for VPC Flow Logs
-
VPC Flow Logs Creation Initiation
- Started VPC Flow Logs creation for
MY-VPC - Enable comprehensive network traffic monitoring
- Started VPC Flow Logs creation for
-
S3 Destination Configuration
- Configured VPC Flow Logs to send data to dedicated S3 bucket
- Enables long-term storage and analysis of network traffic
-
Complete Flow Logs Configuration
- Finalized VPC Flow Logs configuration
- Named
My-VPC-Flow-Logswith S3 bucket destination
-
VPC Flow Logs Creation Success
- Successfully created VPC Flow Logs
- Continuously captures and stores network traffic metadata
-
Internet Gateway Creation
- Created Internet Gateway
My-Public-IGW - Provides internet connectivity for public subnets
- Created Internet Gateway
-
Internet Gateway Creation Success
- Successfully created Internet Gateway
- Will be attached to VPC for bidirectional internet communication
-
Internet Gateway VPC Attachment
- Attached Internet Gateway to
MY-VPC - Establishes connection for public subnet internet access
- Attached Internet Gateway to
-
Internet Gateway Attachment Success
- Successfully attached Internet Gateway to VPC
- Completes foundation for public subnet internet connectivity
-
Web Tier Route Table Creation
- Created
Web-Tier-Route-Tablefor public subnets - Contains routes directing internet traffic to Internet Gateway
- Created
-
Route Table Routes Configuration
- Accessed route editing for Web Tier Route Table
- Add default route (
0.0.0.0/0) to Internet Gateway
-
Internet Gateway Route Addition
- Added default route
0.0.0.0/0targeting Internet Gateway - Enables all traffic from associated subnets to reach internet
- Added default route
-
Web Tier Route Table Completion
- Successfully configured Web Tier Route Table with Internet Gateway route
- Establishes routing foundation for public subnet internet connectivity
-
Subnet Association Configuration
- Initiated subnet association process
- Connect web tier subnets with route table
-
Web Tier Subnets Association
- Associated both
WEB-TIER-SUBNET-1andWEB-TIER-SUBNET-2 - Makes them truly public subnets with internet access capability
- Associated both
-
Public Routing Configuration Success
- Successfully completed web tier routing configuration
- Established internet connectivity for public subnets
-
NAT Gateway 1 Creation
- Created
NAT-GW-1inWEB-TIER-SUBNET-1with Elastic IP - Provides outbound internet connectivity for private subnet resources in AZ
us-east-2a
- Created
-
NAT Gateway 1 Creation Success
- Successfully created
NAT-GW-1with dedicated Elastic IP - Establishes secure outbound internet access for private subnets
- Successfully created
-
NAT Gateway 2 Creation
- Created
NAT-GW-2inWEB-TIER-SUBNET-2with separate Elastic IP - Provides high availability and redundancy across both AZs
- Created
-
NAT Gateway 2 Creation Success
- Successfully created
NAT-GW-2 - Completes high availability setup for private subnet connectivity
- Successfully created
-
App Tier Route Table 1 Creation
- Created
APP-Tier-RT-1route table for private subnet routing in AZus-east-2a - Will direct outbound traffic through
NAT-GW-1
- Created
-
App Tier Route Table 1 Success
- Successfully created
APP-Tier-RT-1 - Establishes routing foundation for application tier connectivity
- Successfully created
-
App Tier Route Configuration
- Configured
APP-Tier-RT-1routes - Add default route for internet-bound traffic through NAT Gateway
- Configured
-
NAT Gateway 1 Route Addition
- Added default route
0.0.0.0/0targetingNAT-GW-1 - Enables outbound internet access for
APP-TIER-SUBNET-1
- Added default route
-
App Tier Route Table 1 Configuration Complete
- Successfully configured
APP-Tier-RT-1with NAT Gateway route - Establishes secure outbound internet connectivity
- Successfully configured
-
App Subnet 1 Association Setup
- Initiated subnet association process
- Connect
APP-TIER-SUBNET-1withAPP-Tier-RT-1
-
App Subnet 1 Route Association
- Associated
APP-TIER-SUBNET-1withAPP-Tier-RT-1 - Establishes routing relationship for private subnet internet access
- Associated
-
App Tier AZ1 Routing Success
- Successfully completed routing configuration for
APP-TIER-SUBNET-1 - Enables secure outbound internet access for application servers
- Successfully completed routing configuration for
-
App Tier Route Table 2 Success
- Successfully created
APP-Tier-RT-2for second Availability Zone - Establishes routing foundation for high availability
- Successfully created
-
NAT Gateway 2 Route Configuration
- Configured
APP-Tier-RT-2with default route targetingNAT-GW-2 - Provides outbound internet connectivity for second AZ
- Configured
-
App Tier Route Table 2 Complete
- Successfully updated
APP-Tier-RT-2routing configuration - Completes NAT Gateway setup for high availability
- Successfully updated
-
App Subnet 2 Route Association
- Associated
APP-TIER-SUBNET-2withAPP-Tier-RT-2 - Enables private subnet internet access through
NAT-GW-2
- Associated
-
Complete Private Routing Success
- Successfully completed all private subnet routing configurations
- Established high availability outbound internet connectivity
-
VPC Resource Map Overview
- Generated comprehensive VPC resource map
- Displays complete network architecture across both AZs
-
Security Groups Creation Initiation
- Started security group creation process
- Implement layered security model with least privilege
-
External Load Balancer Security Group
- Created
1.External-Load-Balancer-SGallowing HTTP (port 80) from anywhere - Internet-facing entry point with public access controls
- Created
-
Web Tier Security Group
- Created
2.Web-Tier-SGallowing HTTP traffic only from1.External-Load-Balancer-SG - Implements security layer restricting web server access to load balancer only
- Created
-
Internal Load Balancer Security Group
- Created
3.Internal-Load-Balancer-SGallowing HTTP traffic only from2.Web-Tier-SG - Enables secure communication between web and application tiers
- Created
-
Application Tier Security Group
- Created
4.App-Tier-SGallowing custom TCP on port 4000 only from3.Internal-Load-Balancer-SG - Restricts application server access to internal load balancer only
- Created
-
Database Tier Security Group
- Created
5.DB-Tier-SGallowing MySQL/Aurora (port 3306) only from4.App-Tier-SG - Most restrictive security layer, allowing database access only from application servers
- Created
-
Complete Security Groups Overview
- Successfully created all five security groups
- Implements layered security model with proper tier isolation
-
DB Subnet Group Creation
- Initiated DB Subnet Group creation
- Specify subnets where RDS database instances can be deployed
-
DB Subnet Group Configuration
- Configured
My-RDS-DB-Subnet-Groupwith both Availability Zones - Selected DB-tier subnets for high availability database deployment
- Configured
-
DB Subnet Group Creation Success
- Successfully created DB Subnet Group
- Establishes foundation for Multi-AZ RDS deployment
-
RDS Aurora Database Creation
- Initiated Aurora MySQL database creation
- Selected Aurora for high performance, availability, and MySQL compatibility
-
Database Credentials Configuration
- Configured database cluster identifier as
My-RDS - Set username as
adminwith strong password
- Configured database cluster identifier as
-
Multi-AZ Database Configuration
- Enabled Multi-AZ deployment with Aurora Replica
- Ensures high availability and automatic failover capability
-
Database Network Configuration
- Configured database with
MY-VPC - Used
My-RDS-DB-Subnet-Groupand5.DB-Tier-SGsecurity group
- Configured database with
-
Database Creation Initiation
- Finalized all database configuration settings
- Initiated Aurora MySQL cluster creation process
-
Database Creation Success
- Successfully created
My-RDSAurora MySQL cluster with Multi-AZ - Provides highly available and scalable database foundation
- Successfully created
-
Test Application Server Launch
- Launched
TEST-APP-SERVERinstance for application configuration - Used proper VPC subnet placement and security group configuration
- Launched
-
Application Server Network Configuration
- Configured
TEST-APP-SERVERwithMY-VPC - Used
APP-TIER-SUBNET-1and4.App-Tier-SGsecurity group
- Configured
-
IAM Role Assignment
- Assigned
abcd-ec2-s3-ssm-roleIAM instance profile - Enables secure access to S3 and Systems Manager
- Assigned
-
Session Manager Connection
- Connected to
TEST-APP-SERVERusing AWS Systems Manager Session Manager - Secure shell access without SSH keys or bastion hosts
- Connected to
-
Session Manager Console Access
- Successfully established Session Manager connection
- Confirmed proper IAM role configuration
-
Administrative Access Setup
- Switched to
ec2-userwith administrative privileges - Established proper user context for application installation
- Switched to
-
MySQL Client Installation
- Successfully installed MySQL client on application server
- Verified installation with
mysql --versioncommand
-
Database Connection Verification
- Successfully tested database connectivity between application server and RDS
- Used RDS endpoint and admin credentials
-
Application Code Deployment
- Downloaded application code from S3 bucket
mys3bucket025 - Transferred Node.js backend source code to application server
- Downloaded application code from S3 bucket
-
Node.js Environment Setup
- Installed Node.js using Node Version Manager (NVM)
- Configured version 16 and installed PM2 process manager
-
Application Dependencies Installation
- Successfully installed application dependencies using
npm install - Resolved security vulnerabilities with
npm audit fix
- Successfully installed application dependencies using
-
Application Service Startup
- Started Node.js application using PM2 process manager
- Configured automatic startup on boot
- Verified application health on port 4000
-
AMI Creation Process
- Initiated AMI creation from configured
TEST-APP-SERVER - Capture complete application setup for automated deployment
- Initiated AMI creation from configured
-
App Server AMI Configuration
- Created
App-Server-ImageAMI with descriptive metadata and tags - Establishes golden image for application server auto scaling
- Created
-
AMI Creation Success
- Successfully created
App-Server-ImageAMI - Available in AMIs console for launch templates and auto scaling groups
- Successfully created
-
Target Group Creation
- Initiated target group creation for application load balancer
- Define health check parameters and routing configuration
-
App Server Target Group Configuration
- Created
App-Server-TGtarget group with port 4000 configuration - Configured proper VPC association
- Important Note:
- Critical: If health check options are not properly selected or configured, targets will always show as "Unhealthy" regardless of the actual application status. The load balancer requires explicit health check validation to mark targets as healthy.
- Created
-
Launch Template Creation
- Created
App-Server-Launch-Templateusing custom AMI - Used
t2.microinstance type, App-Tier security group, and IAM instance profile
- Created
-
Launch Template Success
- Successfully created launch template with all required configurations
- Enables consistent and automated application server deployment
-
Internal Load Balancer Creation
- Initiated internal Application Load Balancer creation
- Distribute traffic between web tier and application tier
-
Internal ALB Configuration
- Configured
2-Internal-Load-Balanceras internal ALB - Proper VPC, both Availability Zones, and appropriate security group
- Configured
-
Internal ALB Target Group Assignment
- Associated
App-Server-TGtarget group with internal load balancer - Configured security group
3.Internal-Load-Balancer-SG
- Associated
-
Test Web Server Launch
- Launched
TEST-WEB-SERVERinstance in web tier subnet - Proper security group configuration for web tier testing
- Launched
-
App Server SNS Topic Creation
- Created SNS topic
App-Server-Notification - Automated notifications for application server auto scaling events
- Created SNS topic
-
SNS Topic Creation Success
- Successfully created
App-Server-Notificationtopic - Establishes foundation for automated application tier monitoring
- Successfully created
-
Email Subscription Configuration
- Created email subscription to
App-Server-Notificationtopic - Used
[email protected]for receiving alerts
- Created email subscription to
-
Web Server SNS Topic
- Created
Web-Server-NotificationSNS topic - Web tier monitoring and alerting
- Created
-
CloudWatch SNS Topic
- Created
CloudWatch-Notificationtopic - General CloudWatch alarms and monitoring alerts
- Created
-
Email Notifications Received
- Verified SNS subscription confirmation emails received
- Confirmed proper email delivery configuration
-
SNS Subscription Confirmation
- Opened SNS subscription confirmation email
- Showed proper topic configuration and subscription details
-
Email Subscription Confirmed
- Successfully confirmed SNS email subscription
- Enabled automated notifications for infrastructure events
-
All Subscriptions Active
- Verified all three SNS topic subscriptions confirmed and active
- Comprehensive monitoring coverage
-
App Server ASG Configuration
- Configured
APP-SERVER-ASGwith target tracking scaling policy at 50% CPU utilization - Notifications enabled and proper health check configuration
- Configured
-
Auto Scaling Group Success
- Successfully created
APP-SERVER-ASG - Minimum capacity of 2 instances, maximum of 4 instances
- Proper tagging for resource management
- Successfully created
-
ASG Instance Launch
- Auto Scaling Group automatically launched new application server instances
- Successful automated deployment based on launch template
-
Web Server Code Deployment
- Downloaded web tier code from S3 bucket to
TEST-WEB-SERVER - Transferred React frontend source code and NGINX configuration files
- Downloaded web tier code from S3 bucket to
-
Web Server File Permissions
- Set proper file ownership and permissions using
chownandchmod - Ensured secure file access and proper web server operation
- Set proper file ownership and permissions using
-
Node.js and React Setup
- Installed Node.js environment and React dependencies
- Prepared environment for React application build and deployment
-
React Application Build
- Successfully executed
npm run build - Created optimized production build of React application
- Successfully executed
-
NGINX Web Server Configuration
- Installed NGINX web server
- Replaced default configuration with custom configuration from S3
- Started NGINX service with automatic startup configuration
-
Application Frontend Testing
- Accessed the deployed 3-tier application through web browser
- Confirmed end-to-end functionality with all tiers integrated
-
VPC Flow Logs Verification
- Verified VPC Flow Logs successfully captured and stored in S3 bucket
- Demonstrated comprehensive network traffic monitoring capability
After creating the Internal Load Balancer, a critical step was performed to update the NGINX configuration file. The DNS name from 2-Internal-Load-Balancer was copied and updated in the nginx.conf file at line 58. This file was then re-uploaded to the S3 bucket mys3bucket025, replacing the old configuration.
For complete web tier automation, the following components were implemented:
- Created AMI from TEST-WEB-SERVER after successful configuration
- Included all NGINX configurations and React build
- Tagged appropriately for identification
- Used Web-Server-Image AMI
- Configured with 2.Web-Tier-SG security group
- Included IAM instance profile for S3 and SSM access
- Set proper instance type and configuration
- Internet-facing Application Load Balancer
- Associated with public subnets (WEB-TIER-SUBNET-1 and 2)
- Used 1.External-Load-Balancer-SG security group
- Configured with Web-Server target group
During testing phase, the 2.Web-Tier-SG security group was temporarily modified to allow HTTP traffic from a specific IP address for testing purposes. This was done to verify frontend application functionality before implementing the complete load balancer setup.
- Type: HTTP
- Port: 80
- Source: My IP (temporary for testing)
- Purpose: Direct access testing before load balancer implementation
Important Security Note: This temporary rule was removed once the External Load Balancer was properly configured and testing was complete. The final configuration only allows traffic from the External Load Balancer security group.
- Issue: The IAM role
abcd-ec2-s3-ssm-role-025-9-14was not appearing in the EC2 instance profile dropdown menu. - Root Cause: EC2 instances require an instance profile, which serves as a container for the IAM role.
Resolution Steps:
# Create Instance Profile
aws iam create-instance-profile --instance-profile-name abcd-ec2-s3-ssm-profile
# Attach Role to Instance Profile
aws iam add-role-to-instance-profile \
--instance-profile-name abcd-ec2-s3-ssm-profile \
--role-name abcd-ec2-s3-ssm-role-025-9-14
# Verify Configuration
aws iam get-instance-profile --instance-profile-name abcd-ec2-s3-ssm-profile- Outcome: The instance profile appeared in the EC2 dropdown menu, enabling successful IAM role attachment.
- Issue: EC2 instances were not appearing as Online in AWS Systems Manager despite correct IAM role.
- Root Cause: Multi-faceted issue involving SSM Agent configuration, network connectivity, and service registration timing.
Resolution Steps:
- IAM Role Verification: Confirmed required policies were attached
- SSM Agent Status Check:
sudo systemctl status amazon-ssm-agent
sudo systemctl start amazon-ssm-agent
sudo systemctl enable amazon-ssm-agent-
Network Connectivity Validation: Verified private subnet instances could reach SSM endpoints
-
Instance Profile Verification: Confirmed IAM role attachment from instance metadata
-
SSM Agent Logs Analysis: Examined agent logs for registration issues
-
Outcome: Instances registered successfully with Systems Manager within 5 minutes after network configuration validation and SSM agent restart.
- Issue: Accessing web application via public IP address returned connection timeout errors.
- Root Cause: Network Access Control Lists (NACLs) were configured with default deny rules, blocking HTTP traffic.
Resolution:
-
Updated NACL inbound rules to explicitly allow HTTP/HTTPS traffic
-
Outcome: Web application became accessible via public IP after NACL configuration correction.
- Resource Right-Sizing: Utilized t2.micro instances appropriate for workload
- Storage Optimization: Configured appropriate EBS volume sizes
- Network Efficiency: Placed resources in same AZ where possible
- Resource Tagging: All resources tagged for cost tracking and management
- EC2 Instances (t2.micro): $51-85/month (2-4 instances per tier)
- RDS Aurora MySQL: ~$45-60/month
- Load Balancers: ~$44/month (internal + external)
- NAT Gateway: ~$45/month per gateway
- Data Transfer: Variable based on usage
- S3 Storage: <$1/month for application code
Estimated Total: $150-250/month for development environment
- Navigate to the External Load Balancer DNS name
- Application automatically routes through all tiers:
- Frontend served by NGINX from React build
- API calls routed through Internal Load Balancer to Node.js
- Database queries handled by Aurora MySQL cluster
- SNS Notifications: Receive alerts for scaling events
- VPC Flow Logs: Analyze network traffic patterns
- Session Manager: Secure access to instances for maintenance
- Auto Scaling: Automatic scaling based on CPU utilization
- Manual Scaling: Adjust ASG capacity as needed
- Database Scaling: Add read replicas for read-heavy workloads
- CloudWatch Dashboards - Custom metrics visualization for all tiers
- CloudWatch Alarms - Automated alerts for CPU, memory, and application metrics
- Application Insights - Detailed performance monitoring and troubleshooting
- Log Analytics - Centralized logging with CloudWatch Logs
- Route 53 Hosted Zone - Custom domain configuration
- Health Checks - DNS-level health monitoring
- Failover Routing - Automated DNS failover policies
- SSL/TLS Certificates - AWS Certificate Manager integration
- AWS WAF - Web Application Firewall for external load balancer
- AWS Config - Resource configuration compliance monitoring
- GuardDuty - Threat detection and security monitoring
- Secrets Manager - Secure credential management
- CloudFront CDN - Global content delivery network
- ElastiCache - In-memory caching for application performance
- RDS Read Replicas - Database read scaling
- Container Migration - ECS/EKS implementation
- CI/CD Pipeline - CodePipeline for automated deployments
- Infrastructure as Code - CloudFormation or Terraform templates
- Blue/Green Deployments - Zero-downtime deployment strategy
- Automated Testing - Integration and performance testing
This project was developed with reference to AWS official documentation and sample implementations:
- AWS Three-Tier Web Architecture Workshop - Reference architecture and implementation patterns
- AWS Well-Architected Framework - Best practices for cloud architecture
- AWS Documentation - Official service documentation and guides
- Architecture Deployment: Multi-AZ 3-Tier Implementation Completed
- Security Configuration: Implemented and Tested
- Documentation: Comprehensive Deployment Guide



















































































































