Deployment diagrams: cloud provider icons
简介 / Introduction
When you draw an architecture diagram, a plain box labelled “server” rarely tells the reader which cloud it belongs to. PlantUML ships official symbol libraries (stdlib) for AWS, Azure and Kubernetes, so a node can carry a vendor-specific stereotype; Mermaid has no icon library, but the same semantics can be expressed with subgraphs, node shapes and colour classes. This post builds the same three-cloud topology in both engines and compares the trade-offs.
PlantUML 版
PlantUML’s approach is to include the vendor icon libraries and then tag nodes with their stereotypes:
!include <awslib/AWSCommon>+!include <awslib/AWSSimplified>— AWS icons and colours;!include <azure/AzureCommon>— Azure icons and colours;!include <k8s/common>— Kubernetes icons and colours.
With the libraries loaded, node "EC2" as ec2 <<AWS-EC2>> renders a node with AWS semantics. Group the nodes into AWS Cloud / Azure / Kubernetes boundaries with package, then add the cross-cloud calls.
1 | @startuml |
A few practical notes:
- The icon libraries are backend resources.
api.puml.onlinealready servesawslib,azureandk8s; for a self-hosted PlantUML you must place the corresponding.pumlfiles on the include path, otherwise the server answerscannot include <awslib/AWSCommon>. - Don’t mix two libraries with the same name (
awslibandawslib14conflict) — pick one and stick to it. - Keep the alias separate from the display label (
as ec2); aliases make cross-cloud edges much easier to read.
Mermaid 版
Mermaid has no vendor icon library. The equivalent is subgraph for cloud boundaries, node shapes for service types, and classDef for colour:
subgraph aws["AWS Cloud"]— cloud vendor / cluster boundary;["Text"]rectangle,[("Text")]cylinder — compute versus storage;-->|label|— an edge with a label.
1 | flowchart TB |
If you really want icons there are two options: add emoji to the label (["🟧 EC2"]), which works in most Markdown renderers but depends heavily on the available fonts; or use Mermaid v11.4.1’s architecture-beta diagram type, which supports cloud-icon groups such as group aws(cloud)[AWS Cloud] (the Mermaid build shipped with this site includes that diagram type).
对比 / Side-by-side
| Aspect | PlantUML | Mermaid |
|---|---|---|
| Where the vendor identity comes from | Official stdlib libraries (awslib / azure / k8s) attached through <<stereotype>> |
No icon library — use subgraph names, node shapes, emoji, or architecture-beta‘s (cloud) groups |
| Cloud boundary | package "AWS Cloud" { ... } |
subgraph aws["AWS Cloud"] |
| Distinguishing service types | Vendor stereotype names (<<AWS-EC2>>, <<Azure-VM>>) |
Node shapes: ["Text"] for compute, [("Text")] for storage |
| Colours | Shipped with the libraries, no style code needed | You write classDef / style yourself |
| Dependencies | The rendering backend must have the stdlib files installed | Pure front-end, no external dependency |
小结 / Wrap-up
When you need a polished vendor look and control the rendering backend, PlantUML’s stdlib is the more direct route — at the price of having the icon files installed server-side. When you need zero dependencies and a diagram that renders anywhere, Mermaid’s subgraphs and node shapes already carry the “who runs where” layer of meaning. The two are not mutually exclusive: keep a PlantUML version for the formal architecture document and a Mermaid version for READMEs and wikis.
- Title: Deployment diagrams: cloud provider icons
- Author: puml.online
- Created at : 2026-11-24 09:00:00
- Updated at : 2026-11-26 01:07:01
- Link: https://puml.online/blog/deployment-diagram-cloud-providers-en/
- License: This work is licensed under CC BY-NC-SA 4.0.