PlantUML supports different extension. This article focuses on the C4 and Azure extension.
PlantUML C4 Extension
The C4 extension provides a simple way to create C4 diagrams using PlantUML.
Usage
Getting Started
To use the C4 extension, you need to include the C4 puml files at the top.
Elements
System Context & System Landscape diagrams
Person
to represent and actorSystem
to show a system as a black-boxSystem_Ext
represent an external systemBoundary
for a generic boundarySystem_Boundary
to show a system as a white-box with its componentsEnterprise_Boundary
Container diagram
Component
for a generic component not specified in detailContainer_Boundary
Layout Options
LAYOUT_TOP_DOWN()
orLAYOUT_LEFT_RIGHT()
LAYOUT_WITH_LEGEND()
LAYOUT_AS_SKETCH()
HIDE_STEREOTYPE()
- https://github.com/adrianvlupu/C4-PlantUML shows Supported Diagram Types
Mapping
Syntax | C4 | Notes |
a -> b : label |
Rel_Neibhor(a, b, alias, "label") |
A close relationship with a label |
a --> b : label |
Rel(a, b, alias, "label") |
Relationship with an arrow |
-down-> |
Rel_D / Rel_Down |
Relationships with a placement |
— | not available | No direction |
---> , ----> , -----> |
Components further away | |
–->> |
Rel |
Further Resources
Libraries
- PlantUML Server | github.com
- C4-PlantUML from Ricardo Niepel | github.com/RicardoNiepel
- C4-PlantUML | github.com/adrianvlupu
- Relationships C4.puml
PlantUML Azure Extension
Usage
Symbols
A list of all supported Azure services can be found in the Azure-PlantUML Azure Symbols Documentation.
Azure Simplified Mode
The Azure extension supports a simplified mode that can be used to hide some details.
To simplify include AzureSimplified.puml
can be used.
!include AzurePuml/AzureCommon.puml
!include AzurePuml/AzureSimplified.puml
!include AzurePuml/AzureC4Integration.puml
Examples
Further Resources
- Azure-PlantUML from Ricardo Niepel | github.com/RicardoNiepel
- Azure Symbols | github.com/RicardoNiepel
- C4-PlantUML | github.com/adrianvlupu
- Azure-PlantUML | awesomeopensource.com – has some description about Azure Simplified Mode