InfraCityOpen editor

Networking

A private network is layers: a public edge, private apps, and an isolated data layer that never faces the internet.

Networking, drawn as an isometric city

The CityScript

This is all there is to it. Change it in the editor and the city redraws.

%% N · Networking
%% Only the load balancer and the gateways touch the internet. The database subnet has no route out at all.
city 48x32

district public "Public subnet" 3,3..17,14
district private "Private subnet" 22,3..46,13
district isolated "Isolated subnet" 22,15..46,23

building igw tower in public "Internet gateway"
  floor igw.f "Gateway"
    room igw.route config "Route table"
building nat tower in public "NAT gateway"
  floor nat.f "NAT"
    room nat.out proxy "Outbound NAT"
building alb depot in public "Load balancer"
  floor alb.f "Balancer"
    room alb.lb proxy "Application LB" port=443
building apps factory in private "App tier"
  floor apps.f "Apps"
    room apps.api service "API" port=8080
    room apps.worker worker "Worker"
building cache factory in private "Cache"
  floor cache.f "Cache"
    room cache.redis cache "Redis" port=6379
building db warehouse in isolated "Database"
  floor db.f "Postgres"
    room db.pg database "Primary" port=5432
    room db.replica database "Replica" port=5432

boundary public-subnet "Public subnet" members=igw,nat,alb
boundary private-subnet "Private subnet" members=apps,cache
boundary isolated-subnet "Isolated subnet" members=db
boundary vpc "VPC" members=public-subnet,private-subnet,isolated-subnet

gate net at 0,8 port=443 "Internet"
link igw.route -> alb.lb "HTTPS" variant=emphasis
link alb.lb -> apps.api "HTTP" variant=security
link apps.api -> db.pg "SQL" variant=security
link apps.api -> cache.redis "cache"
link apps.worker -> nat.out "outbound" variant=dashed
link db.pg -> db.replica "replication" variant=dashed