Archyno
UMLPraxe modelování

Architektura AWS namodelovaná v UML

Běžný AWS diagram je stěna ikonek služeb, která říká, které produkty jste si koupili. Tohle je ten druhý druh: dva diagramy, které řeknou, co smí kam sáhnout, přes který port a které části jsou vaše na výměnu.

8 min čteníUML 2.5.123 z 23

AWS eu-central-1HTTPSHTTPSHTTP :8080TCP 5432«device»Browser«executionEnvironment»CloudFront + S3«device»Application Load Balancer«executionEnvironment»ECS Fargate service«device»RDS PostgreSQL«artifact»api.jar
One AWS workload as a deployment diagram. The box around four of the five nodes is the region; the labels on the paths are the protocol and port, which is the information an icon diagram leaves out.

01Two kinds of AWS diagram

The familiar one is a canvas of service icons with lines between them. It is genuinely good at one job - showing which products are in play to somebody who already knows what those products do - and it is why every AWS deck contains one.

What it does not carry is direction, protocol, port, or whether a line means "calls over the network" or "is configured by". Those four are the entire content of a security review, and they are what somebody staring at an alert at 3am is trying to reconstruct. A deployment diagram carries them, at the cost of looking less like a brochure.

02Reading the topology

Three things on the hero figure are worth copying into your own, and none of them is about AWS.

  1. The region is a box, not a label. Nesting is the containment relationship, so the boundary question - what is inside eu-central-1 and what is not - is answered by geometry rather than by a legend. The browser being outside it is the most important fact on the diagram.
  2. Every path carries a protocol and a port."HTTPS", "TCP 5432". An unlabelled line between a load balancer and a service is a line that has never been checked against a security group.
  3. The artifact sits inside the node that runs it. api.jar inside the Fargate service, rather than beside it with an arrow. What is deployed where is the question this diagram kind exists for.

What is deliberately absent: IAM, CloudWatch, Secrets Manager, the NAT gateway. Every one is real and none of them is a participant in a request path - they are configuration, and putting them on the diagram doubles its size while answering no question anybody asked.

03The same system without the vendors

«use»«use»Order API«interface»IOrderStoreRDS adapter«interface»IFileStoreS3 adapter
The component view. Nothing here is called RDS or S3 except the two adapters, so the question "what would leaving AWS cost?" has an answer you can point at.

This is the diagram that makes cloud architecture reviewable rather than merely documented. The Order API depends on IOrderStore and IFileStore; the adapters name the products. Everything above the adapters is portable by construction, and everything that is not portable is in two boxes you can count.

It is also the half that does not change when the infrastructure does. Move from ECS to EKS, or from eu-central-1 to two regions, and the hero figure is redrawn while this one is untouched - which is the practical reason to keep them apart rather than merging them into one impressive picture.

In one line each

  1. 01Icon diagrams name products; deployment diagrams name paths, protocols and ports.
  2. 02Draw the region as a containing node - nesting is the boundary, no arrow needed.
  3. 03Label every communication path with its protocol and port, or it has not been checked.
  4. 04Put artifacts inside the node that executes them.
  5. 05Leave IAM, logging and secrets off: they are configuration, not participants.
  6. 06Keep the component view separate - it survives the re-platforming that invalidates the topology.

The same treatment applied to a shop is in e-commerce architecture, modelled, and the service-boundary question is taken further in the microservices example.

04Časté dotazy

Má být diagram architektury AWS v UML, nebo v ikonách AWS?

Obojí, pro jiné čtenáře. Diagram s ikonami je lepší na prodej a zaškolení, protože produkty zná každý; UML diagram nasazení je lepší pracovní dokument, protože pojmenovává protokoly, porty a směry - a právě na to se ptá bezpečnostní revize i incident ve tři ráno.

Jak na UML diagramu zobrazit VPC nebo region?

Jako uzel, který ostatní obsahuje, nakreslený tak, že jsou v něm vnořené. Vztahem je samotné obsažení, takže není potřeba šipka, a otázka hranice - co je v regionu a co mimo něj - je vidět na obrázku místo v legendě.

Musím nakreslit každou službu AWS, kterou používáme?

Ne a právě kreslení všech dělá tyhle diagramy nepoužitelnými. Službu zahrňte, pokud přes ni vede cesta požadavku nebo drží stav, který byste museli migrovat; vynechte vše, co je spíš konfigurace než účastník, tedy IAM, CloudWatch nebo Secrets Manager.

Jak zabránit tomu, aby cloudový diagram po migraci zestárl?

Rozdělte ho na dva. Pohled na komponenty pojmenovává smlouvy, na kterých závisí váš kód, a přechod na jinou platformu přežije nedotčený; měnit se musí jen pohled na nasazení, čímž se z překreslení všeho stane úprava jediného diagramu.

Všechny články