Cloud and network diagrams
Regions, networks and subnets are nested zones; machines are cards, a group of identical instances is a pile. Address ranges, ports and protocols go in chips and labels. skemo keeps every arrow clear of the boxes it does not join.
cloud.skemo
//- Cloud infrastructure: a VPC, its subnets, piles of instances
diagram(dir="down")
card#users.edge-svc(icon="globe") Internet
to(lb) HTTPS 443
zone#vpc.vpc(tag="10.0.0.0/16") Production VPC
| eu-west-1 · 3 availability zones
zone#public.subnet(tag="10.0.0.0/24") Public subnet
card#lb.net(icon="network") Load balancer
| TLS 1.3
to(app) 8080
card#nat.net(icon="arrow-up-right") NAT gateway
| outbound only
zone#private.subnet(tag="10.0.1.0/24") Private subnet
cards#app.compute(icon="server" count="6") App servers
| autoscaling 3–12
to(db) 5432
to(cache) 6379
to(nat).dashed updates
card#db.data(icon="database") PostgreSQL
| primary + replica
card#cache.data(icon="zap") Rediscloud.css
.edge-svc { --c: #6B7280; }
.net { --c: #7048E8; --label: "Network"; }
.compute { --c: #3E6FC4; --label: "Compute"; }
.data { --c: #B45309; --label: "Data"; }
.vpc { --z-ink: #2F9E44; --z-border: #8CD69A; }
.subnet { --z-ink: #3E6FC4; }Building blocks
| Write | For |
|---|---|
zone#vpc(tag="10.0.0.0/16") Production VPC | a network with its range as a chip; zones nest |
| eu-west-1 · 3 availability zones under a zone | a description line under the zone's title |
cards#app(count="6") App servers | a pile of identical instances with a ×6 badge |
icon="database" | one of the 2,091 built-in icons, or your own image (Icons) |
to(db) 5432 | an arrow labelled with its port |
|.pill 8080 · http | a port as a pill inside the card |
to(nat).dashed updates | outbound traffic back up to the public subnet: the subnets keep the order they are written in |
A line that starts with an IPv4 address or a CIDR block is shown in monospace, so address plans line up.
A classic network
The default theme ships network types (.t0 to .t3 for tiers, .dmz, .lan,
.cloud for zones), handy for a quick sketch:
zones.skemo
diagram(dir="down")
zone#site.cloud Datacenter
zone#dmz.dmz DMZ
card#web Web
card#mail Mail
zone#lan.lan LAN
card#files Files
card#print PrintersKubernetes
Columns (.col-*) line up pods, services and the machines that host them across zones; named joins merge the calls
of several pods into one line:
The source is on the Layout page.
Tips
- Write zones from the outside in (region, network, subnet) and put each card in the deepest zone it belongs to.
- Two zones linked both ways (the load balancer to the app, the app out through the NAT) keep the order they are
written in. Another arrow that goes back up (a return path, monitoring) can still push the layout around: give it
constraint="false". - Several instances of one thing are one pile, not several cards: the drawing stays as wide as the idea.
- For a page about one network, put a legend of the flow kinds in a corner:
card.legend(at="ne").
See also
- Cards and zones: piles, wide cards, columns, zone tags.
- Animated flows: show traffic moving along the arrows.
- Architecture diagrams for the application view of the same system.
