How traffic flows when a user accesses the application
- User sends HTTPS request The user opens the application in a browser. The request travels through the Internet and enters AWS through the Internet Gateway attached to the VPC.
- Request reaches the Web / Presentation Tier The public EC2 instance in the public subnet receives the request on HTTP/HTTPS. Apache serves frontend content and forwards dynamic API requests to the backend.
- Web tier forwards API call to Application Tier The web server acts as a reverse proxy and sends backend requests to the private EC2 application server running the Python Flask application on port 5000.
- Application Tier queries the Database Tier The Flask application processes business logic and connects to Amazon Aurora PostgreSQL Serverless v2 on port 5432 to read or write application data.
- Response returns to the user Aurora returns data to the application server, the application server sends the processed result back to the web server, and the web server returns the final HTTPS response to the user's browser.