Skip to main content

Full-Stack Production AWS Architecture Blueprint

Rather than learning isolated AWS services in a vacuum, production cloud engineering requires understanding how services interconnect to form a resilient, highly available, and secure distributed system.

This guide provides an end-to-end architectural blueprint of a modern full-stack web and media application (such as a scalable photo-sharing platform) on AWS based on the Cloud X Berry Masterclass.


Interactive AWS Production Architecture Visualizer

Explore the interactive visualizer below to inspect the Multi-AZ VPC topology, the event-driven S3 + Lambda media processing pipeline, and the security/secrets management mesh.

AWS Production Cloud Architecture Blueprint
Internet UsersRoute 53 DNS☁️ VPC (10.0.0.0/16) - Region: us-east-1Public Subnetsβš–οΈ ALB (Multi-AZ)SSL / Layer 7🌐 NAT GatewayOutbound EgressPrivate App Subnets (ASG)πŸ–₯️ EC2 (AZ-a)Spring / NodePort 8080IAM RoleπŸ–₯️ EC2 (AZ-b)Auto ScalingPort 8080IAM RoleIsolated DB SubnetsπŸ—„οΈ Primary RDS (AZ-a)Read/Write (Port 5432)πŸ›‘οΈ Standby Replica (AZ-b)Sync Replication (Auto Failover)
Click an AWS Building Block to inspect its production configuration:
Application Load Balancer (ALB)Traffic Routing & SSL
Production Role: Public Layer 7 load balancer terminating HTTPS (TLS) certificates via AWS Certificate Manager (ACM) and routing traffic to healthy EC2 instances.
πŸ›‘οΈ Security Rules: Security Group: INBOUND 443 (from 0.0.0.0/0), OUTBOUND to EC2 Security Group on port 8080.
⚠️ Production Gotcha: Enable cross-zone load balancing and configure proper health check intervals to prevent routing traffic to unhealthy instances.

1. Network Topology: Multi-AZ Virtual Private Cloud (VPC)

The foundation of every secure AWS workload is a properly structured Multi-AZ VPC (e.g. 10.0.0.0/16) spanning at least two Availability Zones (AZ-a and AZ-b):

Availability ZoneSubnet TierCIDR BlockHosted InfrastructureRoute Table Egress Target
us-east-1aPublic Subnet10.0.1.0/24ALB Node A, NAT Gateway AInternet Gateway (0.0.0.0/0 βž” igw-xxx)
us-east-1aPrivate App Subnet10.0.10.0/24EC2 ASG Instance 1 (Spring Boot)NAT Gateway A (0.0.0.0/0 βž” nat-xxx-a)
us-east-1aIsolated DB Subnet10.0.100.0/24Primary RDS PostgreSQL InstanceLocal VPC only (No internet route)
us-east-1bPublic Subnet10.0.2.0/24ALB Node B, NAT Gateway BInternet Gateway (0.0.0.0/0 βž” igw-xxx)
us-east-1bPrivate App Subnet10.0.20.0/24EC2 ASG Instance 2 (ASG Node)NAT Gateway B (0.0.0.0/0 βž” nat-xxx-b)
us-east-1bIsolated DB Subnet10.0.200.0/24Synchronous Standby RDS ReplicaLocal VPC only (Synchronous disk replication)

Subnet Segmentation & Route Table Rules:

  1. Public Subnets (10.0.1.0/24, 10.0.2.0/24):
    • Route Table: 0.0.0.0/0 βž” Internet Gateway (IGW).
    • Houses public-facing resources: Application Load Balancers (ALB) and NAT Gateways.
  2. Private App Subnets (10.0.10.0/24, 10.0.20.0/24):
    • Route Table: 0.0.0.0/0 βž” NAT Gateway in the corresponding AZ.
    • Houses backend application compute (EC2 Auto Scaling Group / ECS tasks). Instances can make outbound requests to download packages, but cannot be directly reached from the internet.
  3. Isolated Database Subnets (10.0.100.0/24, 10.0.200.0/24):
    • Route Table: Local VPC routing only (no route to IGW or NAT Gateway).
    • Houses Amazon RDS Multi-AZ clusters. Completely air-gapped from internet egress.

2. Defense-in-Depth: Security Group Chaining

Security groups act as stateful firewalls directly attached to Elastic Network Interfaces (ENIs). In production, never open ports to raw CIDR blocks when communicating between internal tiers:

Tier / ENI LayerSecurity Group NameInbound Protocol & PortAllowed SourceSecurity Rationale
Edge Load Balancersg-albHTTPS (TCP 443)0.0.0.0/0 (Public Internet)Public entry point terminating client TLS.
Application Tiersg-app-ec2HTTP (TCP 8080)Source Security Group: sg-albRejects direct internet traffic; only ALB can forward requests.
Database Tiersg-rdsPostgreSQL (TCP 5432)Source Security Group: sg-app-ec2Only application instances can query the database.

3. Asynchronous Media Pipeline: S3 + Lambda + SQS

When users upload photos or heavy files, routing large binary payloads through application servers wastes EC2 CPU, memory, and bandwidth.

The Presigned URL + Event-Driven Pattern:

1. Mobile App ──[ 1. Request Upload URL ]──▢ EC2 App Server
2. Mobile App ◀──[ 2. Return S3 Presigned URL ]── EC2 App Server
3. Mobile App ──[ 3. Direct Binary PUT (15MB Photo) ]──▢ S3 Bucket (photos-raw)
β”‚
s3:ObjectCreated:* Event
β–Ό
AWS Lambda Resizer
β”‚
Writes 256x256 thumbnail
β–Ό
S3 Bucket (photos-thumb)
β”‚
Enqueues AI task
β–Ό
Amazon SQS (AI Queue)
  1. Direct-to-S3 Presigned Uploads: The client asks the backend for an authorized S3 Presigned URL. The client uploads directly to S3 via HTTP PUT, bypassing EC2 entirely.
  2. S3 Event Notifications: S3 automatically triggers an AWS Lambda function upon object creation.
  3. Serverless Image Resizing: Lambda reads the raw photo, creates optimized thumbnail variants, saves them to a public thumbnail bucket, and updates the database.
  4. SQS Decoupling for Heavy AI Work: Lambda publishes an event message to an Amazon SQS queue, buffering work for asynchronous AI moderation workers.

4. Security, Secrets & KMS Envelope Encryption

IAM Roles over Static Credentials

  • Never embed AWS access keys (AKIA...) inside application code or .env files.
  • Attach IAM Instance Profiles to EC2 and Execution Roles to Lambda. AWS STS automatically rotates temporary credentials every 6 hours without application intervention.

Automated Credential Rotation (Secrets Manager + KMS)

  • Database credentials and third-party API tokens are stored in AWS Secrets Manager, encrypted at rest using AWS KMS (Key Management Service).
  • Secrets Manager invokes an automated Lambda rotation function every 30 days to update the RDS master password and update the secret value simultaneously.

5. Production Reliability & Disaster Recovery Checklist

Architectural PillarProduction RequirementImplementation Gotcha
High AvailabilityMulti-AZ Deployment across 2+ AZsEnsure Multi-AZ NAT Gateways (one per AZ) to avoid cross-AZ data transfer fees and single points of failure.
Database FailoverAmazon RDS Multi-AZ Synchronous ReplicationMulti-AZ standby replica does not accept read queries; create Read Replicas for scaling read workloads.
Compute ElasticityEC2 Auto Scaling Group with Target TrackingUse ALB TargetResponseTime or RequestCountPerTarget rather than raw CPU for responsive auto scaling.
Storage OptimizationS3 Lifecycle RulesTransition raw uploads from S3 Standard to S3 Standard-IA (30 days) and S3 Glacier (90 days) to cut storage costs by 80%.
ObservabilityCloudWatch Alarms & X-Ray Distributed TracingSet alarms on ALB 5XXErrorRate > 1% and SQS ApproximateAgeOfOldestMessage > 300s.
πŸ“–
Track Page Progress0 / 635 Read
Knowledge Base Completion0%