A reference blueprint for building security-first, multi-AZ AWS platforms designed for fintech and high-trust production workloads. Every layer—from Cloudflare edge DNS and VPC networking to OpenBao/Vault secrets, immutable AMIs, and ECS/EKS services—is versioned as code using OpenTofu / Terraform, Packer, and Ansible.

Interactive Traffic & Access Flows

Use ▶ Play or select any scenario below to trace inbound client requests, internal private-subnet traffic, AWS VPC Endpoints, outbound NAT egress, and zero-trust operator access across Availability Zones.

Interactive AWS Multi-AZ VPC Traffic & Zero-Trust Access Flows
AWS VPC 10.X.0.0/16 · MULTI-AZ (A / B / C..G) · SECURITY GROUPS & NACLs PUBLIC SUBNETS (10.X.0.0/24 .. 6.0/24) · ONLY PUBLIC ALB (:443) & NAT GATEWAYS · ZERO APPS PRIVATE SUBNETS 10.X.8.0/21 .. 56.0/21 assign_public_ip = false PRIVATE CONNECTIVITY VPC ENDPOINTS — STAYS INSIDE AWS, NO NAT REQUIRED User / Client HTTPS Request TRAFFIC IN (Inbound) Cloudflare Edge DNS · WAF · DDoS *.example.com Internet Gateway VPC Edge (IGW) attached to VPC Operator Device Tailscale + AWS SSO *.prod.example.net Public Load Balancer (ALB) Port 443 Only · Cloudflare SG spans Public Subnets (AZ A / B / C..G) NAT Gateways (Per AZ) Static Elastic IPs (EIP) outbound only · blocks inbound App Tier (AZ A) ECS / EC2 · 10.X.8.0/21 Data & Secrets PostgreSQL · Cache · OpenBao Internal LB (Private) ALB / NLB · Private Only App Tier (AZ B) ECS / EC2 · 10.X.16.0/21 Data & Secrets PostgreSQL · Cache · OpenBao Internal LB (Private) ALB / NLB · Private Only App Tier (AZ C..G) ECS / EC2 · 10.X.24..56.0/21 Data & Secrets PostgreSQL · Cache · OpenBao Internal LB (Private) ALB / NLB · Private Only VPC Endpoints Gateway & Interface (PrivateLink) AWS Service APIs (AWS Backbone) S3 · ECR · ECS · KMS · Logs · SSM · RDS/Cache APIs External Internet Partner APIs / Webhooks TRAFFIC OUT (EIP allowlist) Internet Gateway VPC Egress Path stateful NAT return IAM + SSM Exec CloudTrail · ssmmessages 365-day KMS transcripts Route53 Resolver prod.example.net Split DNS + Tailnet
Inbound / Internal / PrivateLink Outbound (Per-AZ NAT w/ EIP) Operator Zero-Trust (Tailnet + SSM)
Step 1 of 5 · Inbound Traffic (User → Cloudflare → Public Subnet ALB :443 → Private Subnet App)

Client HTTPS requests hit Cloudflare first, enter the VPC via the Internet Gateway, and land on the Public ALB inside the Public Subnets—where port 443 from Cloudflare IPs is the only exposed ingress and zero apps run. The ALB forwards traffic across the Private Subnet boundary to ECS/EC2 workloads launched with assign_public_ip = false (Task SG accepts only the ALB SG), which then talk to PostgreSQL, cache, and OpenBao.

Traffic Path & Security Controls
Inbound: User → Cloudflare (WAF/TLS) → IGW → Public ALB (:443 in Public Subnets) → Private App (assign_public_ip = false) → PostgreSQL / OpenBao

Public Subnets: ALB (:443, Cloudflare SG) + NAT Gateways only — 0 apps Private Subnets: all apps & data; Task SG allows inbound only from ALB SG

Full Multi-AZ Network Blueprint

The complete scalable architecture below maps the Zones A–G pattern, showing inbound traffic (blue), outbound application egress (green), private AWS service connectivity via VPC Endpoints (dashed gray), CIDR allocation, and return paths.

AWS VPC — Multi-AZ Scalable Network Architecture (10.X.0.0/16) Open Light SVG ↗ Open Dark SVG ↗
AWS VPC Multi-AZ scalable network architecture blueprint (light theme) AWS VPC Multi-AZ scalable network architecture blueprint (dark theme)

Traffic Flows & Return Paths

ALBs, NAT Gateways, and Security Groups are stateful (return traffic automatically follows the reverse path), while Network ACLs (NACLs) are stateless and require explicit inbound/outbound return rules:

  • Inbound (Client → App): User → Cloudflare (WAF/TLS) → Internet Gateway → Public Subnet (ALB :443) → Private App—port 443 is the only port exposed on the Public Subnets (origin restricted to Cloudflare IPs via nbari/cloudflare-restrictor/aws / mTLS / origin header), and the Public ALB targets private ECS/EKS/EC2 workloads directly across AZs.
  • Internal (Private Subnet): Private App → Internal ALB/NLB → Target Service—internal load balancers handle private service-to-service traffic inside the VPC.
  • Outbound (App → Internet): Private App → Same-AZ NAT Gateway (Elastic IP) → Internet Gateway → External API—unsolicited inbound connections through NAT are blocked by design.
  • Private AWS Connectivity (No NAT): Private App → VPC Endpoints (Gateway & Interface) → S3 / ECR / ECS / KMS / CloudWatch / SSM / RDS & ElastiCache management APIs—keeps AWS control-plane and storage traffic on the AWS backbone (avoiding NAT data-processing costs), while database and cache data traffic stays directly on private subnets.

Multi-Account VPC & CIDR Scaling Pattern (Zones A–G)

Each environment (dev, staging, prod) runs in its own isolated AWS account with a dedicated, non-overlapping 10.X.0.0/16 CIDR allocated from an explicit CIDR registry / AWS VPC IPAM (for example, 10.10.0.0/16, 10.20.0.0/16, 10.30.0.0/16).

Non-overlapping CIDRs keep peering, Transit Gateway routes, security groups, and VPC Flow Logs unambiguous across accounts. Each Availability Zone gets a compact /24 public subnet for ingress/NAT and a large /21 private subnet for compute and data growth (10.X.7.0/24 is reserved for future use):

AZPublic Subnet (/24)Private App / Data Subnet (/21)Typical Role
A10.X.0.0/2410.X.8.0/21Primary active zone (provisioned by default)
B10.X.1.0/2410.X.16.0/21HA active zone (provisioned by default)
C10.X.2.0/2410.X.24.0/21Quorum / 3-AZ HA zone (provisioned by default)
D10.X.3.0/2410.X.32.0/21Expansion zone
E10.X.4.0/2410.X.40.0/21Expansion zone
F10.X.5.0/2410.X.48.0/21Expansion zone
G10.X.6.0/2410.X.56.0/21Expansion zone

Domain Separation & Zero-Trust Operator Access

Customer-facing product domains and internal operational domains are kept strictly separate:

  • Public product domains (*.example.com) live on Cloudflare and terminate at the origin-restricted Public ALB.
  • Private infrastructure zones (*.prod.example.net, *.staging.example.net, *.test.example.net) exist only in each account's private Route53 hosted zone.

Operator access is split cleanly across two audited paths—with zero public SSH ports or public admin UIs:

  • Private DNS & internal services: Trusted operator devices use Tailscale Split DNS to forward *.example.net queries to a reachable Route53 Resolver inbound endpoint / in-VPC DNS forwarder, while the encrypted tailnet carries access to vault.prod.example.net and internal metrics.
  • Interactive container access: Opt-in ECS Exec runs over IAM-authorized AWS Systems Manager (ssmmessages VPC endpoint for NAT-free operation), streaming KMS-encrypted session transcripts to CloudWatch Logs (365-day retention) alongside authoritative CloudTrail ExecuteCommand audit events.

Repository Layout & Operational Patterns

.
├── cloudflare/               # Public DNS & edge rules (isolated state)
├── modules/                  # Shared IaC modules (ecs_service, private_app, tailscale, alerts)
└── <env>-<account>/
    ├── openbao/              # Policies, auth methods, audit devices, signing integrations
    └── <aws-region>/
        ├── packer/           # Immutable AMIs built with Packer + Ansible
        └── terraform/
            ├── setup/        # One-time account & remote state bootstrap
            ├── vpc/          # Multi-AZ VPC, subnets, NAT, endpoints, IAM, alerting
            ├── services/     # Shared data tier (PostgreSQL, OpenBao storage, ECR)
            └── applications/ # Load balancers, EC2 apps, and ECS Fargate services

Key operational practices baked into the platform:

  • One file per service (clarity over DRY): Each ECS service lives in its own file (ecs_core_api.tf, ecs_worker.tf) instead of being merged into a single for_each map. That keeps diffs and code reviews tightly scoped to one service (while still reviewing the full OpenTofu/Terraform plan before every apply).
  • Reproducible operator environments: Tooling (opentofu/terraform, awscli, packer, ansible, sops, openbao) is pinned with mise inside a DevPod container, with per-account direnv profiles and short-lived AWS IAM Identity Center (SSO) credentials—no long-lived static AWS keys.
  • Encrypted secrets & audited sessions: Repository-managed config is encrypted with SOPS + age, runtime secrets live in OpenBao / Vault, and broad read-only IAM roles are explicitly denied direct access to ECS Exec audit transcripts and ssm:StartSession bypasses.

Need a security-first AWS or database platform like this for your team? Get in touch / Hire Me.